summaryrefslogtreecommitdiffstats
path: root/libunwindstack/DwarfCfa.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of load bias values.Christopher Ferris2018-06-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that for the dwarf information, if a FDE indicates it's pc relative, then pc has to be incremented by the load bias. If not, then it should not be incremented. Previously, the code always subtracted load bias values from pcs, and assumed that all fdes were incremented by load bias values. The new code actually reads the fdes and adjusted the pcs in the fde and in the eh frame hdr so that load bias values are already handled properly. In addition, add dumping of arm exidx values in unwind_reg_info. This allowed verifying that the debug frame in those elf files was being handled properly. Added a new unit test that only has a debug frame that has a non-zero load bias and has fde entries that do not have pc relative encoding. Fix a couple of other small bugs. Bug: 109824792 Test: All libbacktrace/libunwindstack unit tests pass. Test: Ran ART 137-cfi test and 004-ThreadStress. Test: Verify that displaying the fde start and end pc actually match the Test: real data for fde that have pc relative set, and that don't. Test: Verified that the unwind information for arm exidx matches the Test: debug frame data. Change-Id: I707555286b5cb05df9f25489e8c5ede753cfe0fb
* Cache DWARF location rules for a given pc.David Srbecky2018-03-291-2/+11
| | | | | | | | | | | | | | Decoding the DWARF opcodes is expensive so make sure we cache it. This speeds unwinding in simpleperf by over a factor of 3x. Add unit tests for this new behavior. Bug: 77258731 Test: libbacktrace/libunwindstack unit tests on host and target. Test: Ran debuggerd -b on various processes on target. Change-Id: Ia516c0fa5d3e5f76746190bb4b6fdf49fd1c9388
* Don't implicitly dereference DW_CFA_def_cfa_expression.David Srbecky2018-03-081-1/+4
| | | | | | | | The specification isn't entirely clear. Follow the gdb interpretation. Bug: 73954823 Test: libunwindstack_test Change-Id: If72717f54eed84e442f43af19e615143a9796b68
* Add error propagation into Unwinder/Elf objects.Christopher Ferris2018-01-241-12/+17
| | | | | | | | | | | | | | The backtrace offline code uses these error codes to diagnose errors. In addtion, I've had cases where seeing these errors would help diagnose failures. This also allows us to add a few features to indicate why an unwind terminated (such as max frames exceeded). Bug: 65682279 Test: Updated unit tests pass. Change-Id: If82b5092698e8a194016d670efff1320f9b44d50
* Make the library usable as a library.Christopher Ferris2017-07-141-3/+8
| | | | | | | | | | | | | | | | | | | - 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
* Add the Dwarf CFA handling.Christopher Ferris2017-04-241-0/+713
Bug: 23762183 Test: Ran new unit tests. Change-Id: I31abac1238cc671b78a505da655fb6298be072b4