diff options
author | Ryan Prichard <rprichard@google.com> | 2020-09-30 18:31:05 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2020-10-02 16:34:14 -0700 |
commit | b57cc6edc1ab3cc6b5cc9da12eaa1dd7916926cc (patch) | |
tree | 289cc5807ca0461e542221e62ab4ec8934e6edf5 /libunwindstack/LocalUnwinder.cpp | |
parent | 6efcefbd5353c82d7198fa3bad3e391b6e88b87c (diff) | |
download | unwinding-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/LocalUnwinder.cpp')
-rw-r--r-- | libunwindstack/LocalUnwinder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libunwindstack/LocalUnwinder.cpp b/libunwindstack/LocalUnwinder.cpp index 05650fb..5f51a73 100644 --- a/libunwindstack/LocalUnwinder.cpp +++ b/libunwindstack/LocalUnwinder.cpp @@ -113,9 +113,11 @@ bool LocalUnwinder::Unwind(std::vector<LocalFrameData>* frame_info, size_t max_f step_pc -= pc_adjustment; bool finished = false; + bool is_signal_frame = false; if (elf->StepIfSignalHandler(rel_pc, regs.get(), process_memory_.get())) { step_pc = rel_pc; - } else if (!elf->Step(step_pc, regs.get(), process_memory_.get(), &finished)) { + } else if (!elf->Step(step_pc, regs.get(), process_memory_.get(), &finished, + &is_signal_frame)) { finished = true; } |