Fix maps caching for local processes.

It is possible for the map to change while running libunwind. For example,
if lots of threads are doing local unwinds at the same time. Allow the
cached map to regenerate when it detects this case.

Included in this change is a refactor of all of the os code so that it can
also be used to do caching. This is a prelude to being able to attempt to
push the code upstream.

Also, this moves the code back closer to the original upstream code.
Hopefully, this will allow me to upstream all of these changes.

Change-Id: Ia219fa61e16e36416133bc95b1dd2161bd5b8ff7
Fix aarch64 map_local_is_* calls.

Also fix one formatting issue in ia64/Ginit.c.

Change-Id: Idbb112a438a5c59a0fef2949abb07a48c96e0e94
Fix typo in prototype.

Bug: 13816562
Change-Id: Iff1005e6f2b8b13506fc4096a78e3dce3b5847c0
Fix local_get_elf_image prototype.

Change-Id: I3fb0de34ac0447e25b0c0368f76044b4bfc834ba
Fix return code for unmappable elf data.

If an elf image cannot be mapped for the local unwind, then uninitialized data
gets passed back. Fix this to actually return an error code.

Bug: 13897127
Change-Id: I31b66491bbc7d8b7ad99d50d04a33ca1d886a0f7
Use map cache for finding image names.

This change removes the function find_binary_for_address and replaces it
with a call to check the cached map data instead. This is an error path
that hardly ever gets exercised though.

Also fix a couple of warnings in Gfind_proc_info-lsb.c.

Change-Id: Idb501d6674cacfc693fc35608d322ec78f48a4d6
Fix all warnings, and make warnings errors.

Change-Id: Ia2039922b55891551b1de0f0c281c266db6ee219
Make sure that all memory accesses are guarded.

This doesn't protect the fpreg reads completely. It's still possible to have
a bad address that has the first part in readable memory and the second part
in unreadable memory. Since none of the code android uses uses the fpreg
data, this should be okay.

Bug: 13946101

Change-Id: I9187b16d0427cbc8af6751cf0b8476ea2d1bfc38
Add aarch64 getcontext functionality.

Change-Id: I32912a85c0fd02bb5e45a9eb7deb2410ded352a9
Fix x86/x86_64 getcontext overflow problem.

The x86 getcontext code was writing past the end of the context structure.
Fixed this problem, and added a test to make sure that doesn't happen again.
In addition, the x86_64 getcontext was doing the same.

Bug: 14319200
Change-Id: Ia2e2e55fe5459d6c8f8257e787012546b77503c4
Adds static lib targets

Change-Id: I40c84547723967ec369f29b19a037480abeca1dc
Removes dependencies on libgcc

Change-Id: If4ea03b8f4f31f916fbd95d927aca8a499966bab
Add exception handling unwind code.

Fix up the code to work with the map caching code.

This new functionality has not been tested thoroughly.

Change-Id: I8ef22b1125ee888c068f20d2917e2b20d903898e
Use -Wno-header-guard for clang 3.5

Clang 3.5 misdetects the #ifndef UNW_REMOTE_ONLY/#define UNW_LOCAL_ONLY
construct in src/mi/backtrace.c as a header guard with mismatching macro
names, causing a warning in code built with -Werror by default.

While this is a false positive, there's really not much clang can do to
detect this (the code does look exactly like a header guard), so this is
not really a workaround for a compiler bug.

Change-Id: If1e9d8b4344719b706f6e1856c97dfcc2edaeb72
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Populate ucontext_t#fpregs_mem when getting the context

Bug: 12828904
Change-Id: Iecee79d149a2d9009a565fec26690d5c7ef1734a
The build system now supports host arch x86_64.

Bug: 13751317
Change-Id: Ifa1137b120ad3db5e3659431aac9efe8bae59009
Merge "Populate ucontext_t#fpregs_mem when getting the context"