diff options
author | David Srbecky <dsrbecky@google.com> | 2018-03-14 21:30:25 +0000 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2018-03-29 08:47:49 -0700 |
commit | 12d902961b2f119dfccd71523041949ff1668c6e (patch) | |
tree | 62732f2636dd1b34374e499b01880ede276314a7 /libunwindstack/tests/DwarfSectionImplTest.cpp | |
parent | 8dc3f941131332dd240b12fea422c06e0af51572 (diff) | |
download | core-12d902961b2f119dfccd71523041949ff1668c6e.tar.gz core-12d902961b2f119dfccd71523041949ff1668c6e.tar.bz2 core-12d902961b2f119dfccd71523041949ff1668c6e.zip |
Cache DWARF location rules for a given pc.
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
(cherry picked from commit 3386ebade2d28fd3ef68c576bb0375bd226a1320)
Diffstat (limited to 'libunwindstack/tests/DwarfSectionImplTest.cpp')
-rw-r--r-- | libunwindstack/tests/DwarfSectionImplTest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libunwindstack/tests/DwarfSectionImplTest.cpp b/libunwindstack/tests/DwarfSectionImplTest.cpp index c85764c78..c34029130 100644 --- a/libunwindstack/tests/DwarfSectionImplTest.cpp +++ b/libunwindstack/tests/DwarfSectionImplTest.cpp @@ -853,7 +853,8 @@ TYPED_TEST_P(DwarfSectionImplTest, GetCfaLocationInfo_cie_cached) { fde.cfa_instructions_offset = 0x6000; fde.cfa_instructions_end = 0x6002; - dwarf_loc_regs_t cie_loc_regs{{6, {DWARF_LOCATION_REGISTER, {4, 0}}}}; + dwarf_loc_regs_t cie_loc_regs; + cie_loc_regs[6] = DwarfLocation{DWARF_LOCATION_REGISTER, {4, 0}}; this->section_->TestSetCachedCieLocRegs(0x8000, cie_loc_regs); this->memory_.SetMemory(0x6000, std::vector<uint8_t>{0x09, 0x04, 0x03}); |