Better identification of context frames.

Since the introduction of inlined frames, it is not sufficient to check
the stack trace length (== 1) in order to identify context frames.
Updating all location that were depending on this assumption to check
for frame trust level instead.

Change-Id: I98f966889367c2270c268b8e78b67418c89c50f1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3499020
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Ivan Penkov 2022-03-01 21:01:34 +00:00
parent 42d2475617
commit c685fe1153
8 changed files with 42 additions and 33 deletions

View file

@ -123,10 +123,9 @@ StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
frame->trust = StackFrame::FRAME_TRUST_FP;
// Should we terminate the stack walk? (end-of-stack or broken invariant)
if (TerminateWalk(instruction,
stack_pointer,
last_frame->context.gpr[1],
stack->frames()->size() == 1)) {
if (TerminateWalk(instruction, stack_pointer, last_frame->context.gpr[1],
/*is_context_frame=*/last_frame->trust ==
StackFrame::FRAME_TRUST_CONTEXT)) {
return NULL;
}