Support for leaf functions which don't touch any callee-saved registers

for Windows x64 stacks.

According to https://reviews.llvm.org/D2474, LLVM does't generate unwind info for leaf function which doesn't touch any callee-saved
registers. According to MSDN, leaf functions can be unwound simply by
simulating a return.

Change-Id: Ic0503e2aca90b0ba5799133ea8439f1b5f2eefda
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3489332
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Ivan Penkov 2022-02-24 20:49:43 +00:00
parent 88f5fc451e
commit 622a582fa6
3 changed files with 53 additions and 4 deletions

View file

@ -50,9 +50,12 @@ struct StackFrame {
FRAME_TRUST_CFI_SCAN, // Found while scanning stack using call frame info
FRAME_TRUST_FP, // Derived from frame pointer
FRAME_TRUST_CFI, // Derived from call frame info
FRAME_TRUST_PREWALKED, // Explicitly provided by some external stack walker.
// Explicitly provided by some external stack walker.
FRAME_TRUST_PREWALKED,
FRAME_TRUST_CONTEXT, // Given as instruction pointer in a context
FRAME_TRUST_INLINE // Found by inline records in symbol files.
FRAME_TRUST_INLINE, // Found by inline records in symbol files.
// Derived from leaf function by simulating a return.
FRAME_TRUST_LEAF,
};
StackFrame()
@ -85,7 +88,9 @@ struct StackFrame {
return "stack scanning";
case StackFrame::FRAME_TRUST_INLINE:
return "inline record";
default:
case StackFrame::FRAME_TRUST_LEAF:
return "simulating a return from leaf function";
default:
return "unknown";
}
}