summaryrefslogtreecommitdiff
path: root/libunwindstack/include/unwindstack/Memory.h
AgeCommit message (Collapse)Author
2018-01-12Add ability to read jit gdb data.Christopher Ferris
Changes: - New JitDebug class to handle all of the jit gdb interface. - Add unit tests for all, along with new offline test using debug data. - Add new Memory type called MemoryOfflineParts that has multiple MemoryOffline objects to support the offline test. - Update the tools to use the JitDebug object. - Modify libbacktrace to use the JitDebug, but only looking in libart.so and libartd.so. - Change the Format32Bits to Is32Bit since it's more accurate and I use it in a different context where original name didn't make sense. - Add a new function to find global variables in an elf file (GetGlobalVariable). - Add a new function to determine if a pc is valid for this elf (IsValidPc). Bug: 68396769 Test: Ran new unit tests. Added new offline test that uses jit debug data. Test: Ran art test that generates jit data and verified a crash unwinds Test: through the jit data. Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
2017-12-07Add method to detect remote read function to use.Christopher Ferris
The process_vm_read function is much faster than ptrace, but sometimes that will not work on a remote process. Modify the libunwindstack MemoryRemote object to figure out which one it can use. Wrote new unit test to verify this checking behavior. Modify libbacktrace so that the read from libunwind is used instead of using the default ptrace calls. Add some benchmarks to libbacktrace to compare the two different methods. Test: Ran unit tests libbacktrace/libunwindstack/debuggerd. Test: Ran debuggerd -b <SYSTEM_SERVER_PID> Test: Ran debuggerd -b <MEDIACODEC PID> Test: Ran debuggerd -b <RANDOM_PID> Test: Used crasher to create tombstones and verified stack data is Test: dumped properly. Change-Id: If75ca238289532dd8e1de430d569cabb2523380a
2017-11-15unwindstack: rename Memory::ReadPartially to Read.Josh Gao
Test: mma Test: treehugger Change-Id: I53c2c5600fb44620b629c01db85a67789594595f
2017-11-15unwindstack: rename Memory::Read to ReadFully.Josh Gao
Rename Memory::Read to ReadFully to match its semantics with that of android::base. ReadPartially will be renamed to Read in a follow up commit, kept intentionally separate so that there aren't any callers accidentally switched from ReadFully to Read. Test: treehugger Change-Id: I7d845ac5244c3025d92c8512e960e5d0d1da05af
2017-11-15unwindstack: add Memory::ReadPartially.Josh Gao
Add a way to read while allowing for partial reads. Test: new tests added to libunwindstack_test, ran 32/64 on hikey960, sailfish Test: ran unwind on hikey960/sailfish Change-Id: I8b11d9230fcd3122148ef3f980863ac1404ad70a
2017-09-05Add a method to share the process memory object.Christopher Ferris
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
2017-07-14Make the library usable as a library.Christopher Ferris
- 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