summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/ElfCacheTest.cpp
AgeCommit message (Collapse)Author
2020-10-16Remove libprocinfo, libbacktrace, libunwindstackBaligh Uddin
These projects have moved to a different location. platform/system/core [libprocinfo] -> platform/system/libprocinfo platform/system/core [libbacktrace] -> platform/system/unwinding [libbacktrace] platform/system/core [libunwindstack] -> platform/system/unwinding [libunwindstack] BUG: 163786882 Test: Local build + TH Change-Id: Id6d278d917236df0ffd40b5c32593856e112cb5b
2020-01-22Properly handle empty map after read-only map.Christopher Ferris
Recently, the maps for an elf in memory might show up looking like: f0000-f1000 0 r-- /system/lib/libc.so f1000-f2000 0 --- f2000-f3000 1000 r-x /system/lib/libc.so f3000-f4000 2000 rw- /system/lib/libc.so The problem is that there is logic in the code that assumed that the map before the execute map must be the read-only map. In the case above, this is not true. Add a new prev_real_map that will point to the previous map that is not one of these empty maps. This will fix the backtraces that look like this: #00 pc 0000000000050d58 /apex/com.android.runtime/lib64/bionic/libc.so!libc.so (offset 0x50000) (syscall+24) (BuildId: 5252408bf30e395d49ee270b54c77ca4) To get rid of the !libc.so and the offset value, which is not correct. Added new unit tests to verify this. Added new offline test which an empty map between read-only and execute map. Before this change, the backtraces had lines like libc.so!libc.so (offset XXX) would be present. Bug: 148075852 Test: Ran unit tests. Change-Id: Ie04bfc96b8f91ed885cb1e655cf1e346efe48a45
2019-06-20Switch case to suite to follow new gtest naming.Christopher Ferris
Bug: 135528735 Test: All unit tests pass. Change-Id: I1f3dc6fe381ec557b6b7bc5cb1c58d210efa63da
2018-11-14switch to using android-base/file.h instead of android-base/test_utils.hMark Salyzyn
Test: compile Bug: 119313545 Change-Id: I4f7ad84743e974b4b4d1d7256088f6c8b749a237
2018-10-29Verify that the elf matches the expected arch.Christopher Ferris
To avoid a case where a malicious app might try and trick the system to create an elf and register object that mismatches, always verify that they are the same arch. Test: Ran unit tests. Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
2018-10-23Always init gnu_debugdata interface if it exists.Christopher Ferris
Every real call always sets the value to true to init the gnu_debugdata interface, so remove this parameter. Test: Builds, unit tests pass. Change-Id: I07fb3adbbd5b65b51c0dc7608561e820a5095051
2018-10-03Implement support for linker rosegment option.Christopher Ferris
The rosegment linker option results in two maps containing the elf data existing. One is an execute map where the code lives, and the other is the read-only segment which contains the elf header information. If the file backing a shared library in memory is not readable, then the new code will attempt to find the read-only map that has the same name as the current execute segment, and that is at offest zero in the file. Add new unit tests for this functionality. Add the missing MapInfoCreateMemoryTest.cpp to the list of tests. Bug: 109657296 Test: Pass new unit tests. Test: All unit libbacktrace/libunwindstack tests pass with rosegment enabled. Change-Id: If8f69e4a067d77b3f2a7c31e2e5cd989a0702a8c
2018-02-16Modify elf cache to handle elf_offsets properly.Christopher Ferris
Bug: 73498823 Test: All unit tests pass. Test: Simpleperf run that previously failed, passes now. Change-Id: Iff3a1f2f641a46ab9a0326579af3649f0c76fc65
2018-01-25Add a global elf cache.Christopher Ferris
Bug: 65682279 Test: Ran new unit tests. Change-Id: I19c64614b2b11a27f58204d4cc34913c02e04c36