mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-26 17:25:04 +01:00
More robust stack walks when the IP address in the context frame is invalid (or not in a known module).
This is achieved by: 1. Extending the span of the scan for return address in the conext frame. Initially, I wanted to extend the span of the scan for all frames but then I noticed that there is code for ARM already that is extending the search only for the context frame. This kind of makes sense so I decided to reuse the same idea everywhere. 2. Attempting to restore the EBP chain after a successful scan for return address so that the stackwalker can switch back to FRAME_TRUST_CFI for the rest of the frames when possible. I also fixed the lint errors in the files touched. Review URL: https://breakpad.appspot.com/605002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1193 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
56cf4aa3d9
commit
374e8dcfa7
5 changed files with 350 additions and 105 deletions
|
|
@ -166,14 +166,8 @@ StackFrameARM* StackwalkerARM::GetCallerByStackScan(
|
|||
uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP];
|
||||
uint32_t caller_sp, caller_pc;
|
||||
|
||||
// When searching for the caller of the context frame,
|
||||
// allow the scanner to look farther down the stack.
|
||||
const int kRASearchWords = frames.size() == 1 ?
|
||||
Stackwalker::kRASearchWords * 4 :
|
||||
Stackwalker::kRASearchWords;
|
||||
|
||||
if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc,
|
||||
kRASearchWords)) {
|
||||
frames.size() == 1 /* is_context_frame */)) {
|
||||
// No plausible return address was found.
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue