aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-02-23 22:56:53 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-02-23 22:56:53 +0000
commit84a55c5a722c26304498b3fc2546a98cbc30a2e0 (patch)
treefa1591b068b31d17ed9b69d7196b5ce3be4f1acf /src/google_breakpad/processor
parentHandle program strings with the assignment operator smashed against the next (diff)
downloadbreakpad-84a55c5a722c26304498b3fc2546a98cbc30a2e0.tar.xz
Support for .raSearch in the x86 stackwalker
Patch by Benjamin Smedberg <bsmedberg@gmail.com> git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@927 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r--src/google_breakpad/processor/stackwalker.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h
index 6822f16a..614e31b5 100644
--- a/src/google_breakpad/processor/stackwalker.h
+++ b/src/google_breakpad/processor/stackwalker.h
@@ -108,6 +108,15 @@ class Stackwalker {
// Returns false otherwise.
bool InstructionAddressSeemsValid(u_int64_t address);
+ template<typename InstructionType>
+ bool ScanForReturnAddress(InstructionType location_start,
+ InstructionType *location_found,
+ InstructionType *ip_found) {
+ const int kRASearchWords = 30;
+ return ScanForReturnAddress(location_start, location_found, ip_found,
+ kRASearchWords);
+ }
+
// Scan the stack starting at location_start, looking for an address
// that looks like a valid instruction pointer. Addresses must
// 1) be contained in the current stack memory
@@ -120,10 +129,10 @@ class Stackwalker {
template<typename InstructionType>
bool ScanForReturnAddress(InstructionType location_start,
InstructionType *location_found,
- InstructionType *ip_found) {
- const int kRASearchWords = 30;
+ InstructionType *ip_found,
+ int searchwords) {
for (InstructionType location = location_start;
- location <= location_start + kRASearchWords * sizeof(InstructionType);
+ location <= location_start + searchwords * sizeof(InstructionType);
location += sizeof(InstructionType)) {
InstructionType ip;
if (!memory_->GetMemoryAtAddress(location, &ip))