aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor
diff options
context:
space:
mode:
authorivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-06-26 00:16:11 +0000
committerivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-06-26 00:16:11 +0000
commit374e8dcfa7f53f3af6916b54c26217849545bb2b (patch)
tree9ff0e91141ffac9c41aba56cbf8139fa58033b70 /src/google_breakpad/processor
parentEliminate redundant initialization following r1188, (diff)
downloadbreakpad-374e8dcfa7f53f3af6916b54c26217849545bb2b.tar.xz
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
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r--src/google_breakpad/processor/stackwalker.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h
index 3640cc73..11039d6e 100644
--- a/src/google_breakpad/processor/stackwalker.h
+++ b/src/google_breakpad/processor/stackwalker.h
@@ -126,9 +126,16 @@ class Stackwalker {
template<typename InstructionType>
bool ScanForReturnAddress(InstructionType location_start,
InstructionType* location_found,
- InstructionType* ip_found) {
+ InstructionType* ip_found,
+ bool is_context_frame) {
+ // When searching for the caller of the context frame,
+ // allow the scanner to look farther down the stack.
+ const int search_words = is_context_frame ?
+ kRASearchWords * 4 :
+ kRASearchWords;
+
return ScanForReturnAddress(location_start, location_found, ip_found,
- kRASearchWords);
+ search_words);
}
// Scan the stack starting at location_start, looking for an address