summaryrefslogtreecommitdiff
path: root/libunwindstack/Elf.cpp
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2020-09-30 18:31:05 -0700
committerChristopher Ferris <cferris@google.com>2020-10-02 16:34:14 -0700
commitb57cc6edc1ab3cc6b5cc9da12eaa1dd7916926cc (patch)
tree289cc5807ca0461e542221e62ab4ec8934e6edf5 /libunwindstack/Elf.cpp
parent6efcefbd5353c82d7198fa3bad3e391b6e88b87c (diff)
downloadunwinding-b57cc6edc1ab3cc6b5cc9da12eaa1dd7916926cc.tar.gz
libunwindstack: Support signal frame CIEs.
Mark a CIE with a S in its augmentation string as signal frame. This allows the code to properly handle signal frame data if none of the signal frame pattern matchers work. For a signal frame, DwarfSectionImpl<AddressType>::Eval needs to continue the unwinding even if PC is zero. A zero PC means that the program has crashed, and we should try to recover the real PC using the return address on the stack or LR. This behavior is tested by UnwindOffline.signal_{x86,x86_64}, which modify the libc.so files so that the signal frame pattern matcher fails and the CIE/FDE data is used instead. Test: libunwindstack_test Change-Id: I4655b070028fd984345311a5e743796f8c30ed36
Diffstat (limited to 'libunwindstack/Elf.cpp')
-rw-r--r--libunwindstack/Elf.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libunwindstack/Elf.cpp b/libunwindstack/Elf.cpp
index 286febc..e098a58 100644
--- a/libunwindstack/Elf.cpp
+++ b/libunwindstack/Elf.cpp
@@ -188,14 +188,15 @@ bool Elf::StepIfSignalHandler(uint64_t rel_pc, Regs* regs, Memory* process_memor
}
// The relative pc is always relative to the start of the map from which it comes.
-bool Elf::Step(uint64_t rel_pc, Regs* regs, Memory* process_memory, bool* finished) {
+bool Elf::Step(uint64_t rel_pc, Regs* regs, Memory* process_memory, bool* finished,
+ bool* is_signal_frame) {
if (!valid_) {
return false;
}
// Lock during the step which can update information in the object.
std::lock_guard<std::mutex> guard(lock_);
- return interface_->Step(rel_pc, regs, process_memory, finished);
+ return interface_->Step(rel_pc, regs, process_memory, finished, is_signal_frame);
}
bool Elf::IsValidElf(Memory* memory) {