aboutsummaryrefslogtreecommitdiff
path: root/src/processor/stackwalker_x86.h
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-02-05 18:04:56 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-02-05 18:04:56 +0000
commit7f1455601db0fe4a44bcc9b38bd5b28bfbd37aba (patch)
tree96ffb5f4acb3ec70a4a3a8bf58e0ac4940f0d6da /src/processor/stackwalker_x86.h
parentBreakpad processor: Support evaluating a postfix expression to produce a value. (diff)
downloadbreakpad-7f1455601db0fe4a44bcc9b38bd5b28bfbd37aba.tar.xz
Breakpad processor: Segregate STACK WIN vs. traditional stack walking.
This patch moves the code for finding caller frames using STACK WIN data and the code to do so using the traditional frame layout (%ebp points at saved %ebp, pushed just after return address) into their own functions. In addition to making things a little clearer, this is preparation for adding support for STACK CFI records into the mix. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@512 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/stackwalker_x86.h')
-rw-r--r--src/processor/stackwalker_x86.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/processor/stackwalker_x86.h b/src/processor/stackwalker_x86.h
index 255c16b3..b4d134ea 100644
--- a/src/processor/stackwalker_x86.h
+++ b/src/processor/stackwalker_x86.h
@@ -1,3 +1,5 @@
+// -*- mode: c++ -*-
+
// Copyright (c) 2006, Google Inc.
// All rights reserved.
//
@@ -42,6 +44,7 @@
#include "google_breakpad/common/breakpad_types.h"
#include "google_breakpad/common/minidump_format.h"
#include "google_breakpad/processor/stackwalker.h"
+#include "google_breakpad/processor/stack_frame_cpu.h"
namespace google_breakpad {
@@ -66,8 +69,22 @@ class StackwalkerX86 : public Stackwalker {
// stack conventions (saved %ebp at [%ebp], saved %eip at 4[%ebp], or
// alternate conventions as guided by any WindowsFrameInfo available for the
// code in question.).
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack *stack);
+ virtual StackFrame *GetContextFrame();
+ virtual StackFrame *GetCallerFrame(const CallStack *stack);
+
+ // Use windows_frame_info (derived from STACK WIN and FUNC records)
+ // to construct the frame that called frames.back(). The caller
+ // takes ownership of the returned frame. Return NULL on failure.
+ StackFrameX86 *GetCallerByWindowsFrameInfo(
+ const vector<StackFrame*> &frames,
+ WindowsFrameInfo *windows_frame_info);
+
+ // Assuming a traditional frame layout --- where the caller's %ebp
+ // has been pushed just after the return address and the callee's
+ // %ebp points to the saved %ebp --- construct the frame that called
+ // frames.back(). The caller takes ownership of the returned frame.
+ // Return NULL on failure.
+ StackFrameX86 *GetCallerByEBPAtBase(const vector<StackFrame*> &frames);
// Scan the stack starting at location_start, looking for an address
// that looks like a valid instruction pointer. Addresses must