Update the Unwinder object and add tests.
Changes:
- Remove unused GetReturnAddressFromDefault function and tests.
- Modify the unwinder to stop when a pc/sp in a device map.
- Modify the unwinder to skip initial frames based on map names.
- Unit tests that exercise all of the paths in the unwinder code.
- Move the test Elf/ElfInterface objects into their own file.
- Update RegsFake to handle extra cases.
- Modify libbacktrace code to use this unwinder.
The new unwinder does not implement the ignore frame functionality since
this is not used very often and is better implemented using a skip frames
in named libraries functionality.
Test: Ran new unit tests, ran backtrace tests.
Change-Id: Ifd65e9acd66ac5e2d0e04bd32a9ad870b54610ff
diff --git a/libunwindstack/tests/DwarfOpTest.cpp b/libunwindstack/tests/DwarfOpTest.cpp
index 47a40cf..2d5007b 100644
--- a/libunwindstack/tests/DwarfOpTest.cpp
+++ b/libunwindstack/tests/DwarfOpTest.cpp
@@ -1486,7 +1486,7 @@
}
this->op_memory_.SetMemory(0, opcode_buffer);
- RegsFake<TypeParam> regs(32, 10);
+ RegsImplFake<TypeParam> regs(32, 10);
for (size_t i = 0; i < 32; i++) {
regs[i] = i + 10;
}
@@ -1518,7 +1518,7 @@
};
this->op_memory_.SetMemory(0, opcode_buffer);
- RegsFake<TypeParam> regs(16, 10);
+ RegsImplFake<TypeParam> regs(16, 10);
for (size_t i = 0; i < 16; i++) {
regs[i] = i + 10;
}
@@ -1544,7 +1544,7 @@
0x92, 0x80, 0x15, 0x80, 0x02};
this->op_memory_.SetMemory(0, opcode_buffer);
- RegsFake<TypeParam> regs(10, 10);
+ RegsImplFake<TypeParam> regs(10, 10);
regs[5] = 0x45;
regs[6] = 0x190;
this->op_->set_regs(®s);