diff options
author | Sim Sun <sunsj1231@gmail.com> | 2020-01-14 21:48:37 -0800 |
---|---|---|
committer | Joshua Peraza <jperaza@chromium.org> | 2020-01-21 16:57:57 +0000 |
commit | 13c1568702e8804bc3ebcfbb435a2786a3e335cf (patch) | |
tree | 3787cd4d2a2b2f510acd6565f1635883ea8ea8c5 /src/processor/stackwalker_arm64.h | |
parent | Extract the exception record from the minidump (diff) | |
download | breakpad-13c1568702e8804bc3ebcfbb435a2786a3e335cf.tar.xz |
arm64: recover register X30(LR) when fallback to frame pointer unwinder
Stackwalk can't recover caller's register X30($LR) value by STACK CFI info.
This will lead unwinding stop immediately when fallback to frame pointer unwinder.
This PR will use try to use second last frame to recover register X30($LR) by frame pointer.
And we will give up correction if STACK CFI info doesn't agree with frame pointer info.
Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=808
Change-Id: I50649e3398e268b02ff297e83db21d05705c2a2d
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1992641
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Diffstat (limited to 'src/processor/stackwalker_arm64.h')
-rw-r--r-- | src/processor/stackwalker_arm64.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/processor/stackwalker_arm64.h b/src/processor/stackwalker_arm64.h index 241383ea..39735c67 100644 --- a/src/processor/stackwalker_arm64.h +++ b/src/processor/stackwalker_arm64.h @@ -90,6 +90,13 @@ class StackwalkerARM64 : public Stackwalker { // of the returned frame. Return NULL on failure. StackFrameARM64* GetCallerByStackScan(const vector<StackFrame*> &frames); + // GetCallerByFramePointer() depends on the previous frame having recovered + // x30($LR) which may not have been done when using CFI. + // This function recovers $LR in the previous frame by using the frame-pointer + // two frames back to read it from the stack. + void CorrectRegLRByFramePointer(const vector<StackFrame*>& frames, + StackFrameARM64* last_frame); + // Stores the CPU context corresponding to the youngest stack frame, to // be returned by GetContextFrame. const MDRawContextARM64* context_; |