History log of /system/core/libunwindstack/include/unwindstack/MapInfo.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0b79ae155f0a5740a04723071e9f05f2527cbb86 25-Jan-2018 Christopher Ferris <cferris@google.com> Add a global elf cache.

Bug: 65682279

Test: Ran new unit tests.
Change-Id: I19c64614b2b11a27f58204d4cc34913c02e04c36
/system/core/libunwindstack/include/unwindstack/MapInfo.h
e7b6624c3fd6bb780f6330448fad175e80469384 15-Dec-2017 Christopher Ferris <cferris@google.com> Fix issues in libunwindstack.

- Add a load_bias field in MapInfo so that it can be loaded offline,
and also so it can be cached.
- Add an Add function to the Maps class so that it's possible to manually
create a map.
- Remove the OfflineMaps class since I haven't found a reason for this to
exist.
- Add a pointer to the gnu debugdata compressed section in the interface
itself and modify the step path to try eh_frame, then debug_frame, then
gnu_debugdata. This way arm can add exidx as the last step behind
gnu_debugdata. Add an offline test to verify the order of unwind.
- Fix x86_64_ucontext_t since it was a different size on 32 bit and 64 bit
systems.

Test: Pass new unit tests.
Change-Id: I978b70d6c244bd307c62a29886d24c1a8cb2af23
/system/core/libunwindstack/include/unwindstack/MapInfo.h
b7de5f542925216dbb8b7124260d2915570598d1 02-Dec-2017 Christopher Ferris <cferris@google.com> Demand read load bias for a map.

Add a static GetLoadBias method to the Elf object that only reads just
enough to get the load bias.

Add a method to MapInfo that gets the load bias. First attempt to get
it if the elf object already exists. If no elf object was created, use
the new static method to get the load bias.

In BacktraceMap, add a custom iterator so that when code dereferences
a map element, that's when the load bias will be retrieved if it hasn't
already been set.

Bug: 69871050

Test: New unit tests, verify tombstones have non-zero load bias values for
Test: libraries with a non-zero load bias.
Change-Id: I125f4abc827589957fce2f0df24b0f25d037d732
/system/core/libunwindstack/include/unwindstack/MapInfo.h
be788d891da26943b1ad6abe0f07a8745fa676d5 27-Nov-2017 Christopher Ferris <cferris@google.com> Allow multiple threads sharing a map to unwind.

Add a mutex in MapInfo, and a mutex in Elf. Lock the creation of an Elf
file using the MapInfo mutex, and lock when calling Step, GetFunctionName,
or GetSoname since they can modify information in the object. It might
be beneficial to use a fine grained lock in the future.

Change the Maps object to contain a vector of MapInfo pointers rather
than the total objects. This avoids copying this data around.

Add a test to libbacktrace to verify that sharing a map while doing
unwinds in different threads works.

Add concurrency tests in libunwindstack to verify the locking works.

Add always inline to the RegsGetLocal arm and aarch64 functions. I had
a case where clang did not inline the code, so make sure this is specified.

Bug: 68813077

Test: New unit tests to cover the case. Passes all unit tests.
Test: Ran a monkey test while dumping bugreports and verified that
Test: no crashes in libunwind.
Test: Remove the locking and verified that all of the concurrenty tests fail.
Change-Id: I769e728c676f6bdae9e64ce4cdc03b6749beae03
/system/core/libunwindstack/include/unwindstack/MapInfo.h
5f118519fd323a0c71b54de9279e8a9ea6a56271 01-Sep-2017 Christopher Ferris <cferris@google.com> Add a method to share the process memory object.

New function to create the process memory object. This allows for
a future where different remote process memory objects could be created
depending on the way remote memory can be created. Even different local
memory objects that access memory without doing any checks.

It also allows MemoryRange objects to share one single process memory object
and could help if the process memory object caches data.

Small changes to MapInfo::CreateMemory to when some errors are detected.
- Always check if the map is a device map, instead of only if the name
is not empty.
- Check if a memory map is readable before creating the memory from process
memory.

Bug: 23762183

Test: Ran unit tests, unwound on device using the new code.
Change-Id: I12a93c2dc19639689a528ec41c67bfac74d431b3
/system/core/libunwindstack/include/unwindstack/MapInfo.h
3f805ac3f8e61489f66a54bbdb1a8dd541c043d1 30-Aug-2017 Christopher Ferris <cferris@google.com> Add proper support for embedded elf files.

- Add a method to get the max size of an elf file by reading the
section header offset + size. This will properly map an elf
file embedded into an apk, instead of just mapping in what is done
by the dynamic linker. It does assume that the section headers are
at the end of the elf file.
- Add new tests for the above functionality.
- Update the unwind_symbols tool to take an address for finding a
function instead of dumping the entire symbol table.

Bug: 23762183

Test: Unit tests pass, unwind through the camera process and verify
Test: the GoogleCamera.apk shows some function names.
Change-Id: I00c021680fe1d43b60d652bf91bbf6667d9617be
/system/core/libunwindstack/include/unwindstack/MapInfo.h
6f3981c181677830c33093411b51ad6b0bf2e337 27-Jul-2017 Christopher Ferris <cferris@google.com> Add support for the new unwind method.

Also add a comment to the GetElf function to indicate that it never returns
nullptr.

Also needed to add this library to the a million and one places that the vndk
has hard-coded this data.

Bug: 23762183

Test: Built, nothing uses the new code.
Test: However, I did run backtrace_test using this code, and all tests pass.
Change-Id: Ib270665dcb7a7607075e36d88be76dbde6e2faa8
(cherry picked from commit dc4104b720c7fd2014ccfa9fa621d02df58a43c4)
/system/core/libunwindstack/include/unwindstack/MapInfo.h
bd625efbca611f56f9e206e8f876e128a1dd5364 02-Aug-2017 Christopher Ferris <cferris@google.com> Revert "Add support for the new unwind method."

This reverts commit 5b460d13a4c383fa6c9a416d64502430ab065209.

Reason for revert: Strange sailfish boot problem.

Change-Id: Ibde9375405cca4343c262335647dac120aab4d73
/system/core/libunwindstack/include/unwindstack/MapInfo.h
5b460d13a4c383fa6c9a416d64502430ab065209 27-Jul-2017 Christopher Ferris <cferris@google.com> Add support for the new unwind method.

Also add a comment to the GetElf function to indicate that it never returns
nullptr.

Bug: 23762183

Test: Built, nothing uses the new code.
Test: However, I did run backtrace_test using this code, and all tests pass.

Change-Id: I252b9c2497e2d3d94347dd6e506170bf50cbfe16
/system/core/libunwindstack/include/unwindstack/MapInfo.h
d226a5140989f509a0ed3e2723f05d5fc93ce8df 14-Jul-2017 Christopher Ferris <cferris@google.com> Make the library usable as a library.

- Add namespace unwindstack everywhere so that it's easier for other
code to use the library.
- Move some of the header files into include/unwindstack so that they
can be exposed.
- Modify the headers so that only a limited number need to be exposed.
- Update the tools to use the new headers.
- Add a GetLoadBias() call on the Elf object. This prevents the need
to get the interface object out of the Elf object.
- Move the GetRelPc() call out of the Reg class, to the Elf class. It's
not always the case that a Reg object will be around when you want to
get a relative pc. The tests for this moved to ElfTest.cpp.

Bug: 23762183

Test: Unit tests pass.
Change-Id: Iac609dac1dd90ed83d1a1e24ff2579c96c023bc3
/system/core/libunwindstack/include/unwindstack/MapInfo.h