diff options
author | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-01-14 19:17:36 +0000 |
---|---|---|
committer | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-01-14 19:17:36 +0000 |
commit | 2684b4dc196ca2da9466aa5391f5c0090739d2f6 (patch) | |
tree | 915b756348bebc378ba53e3137aa7ba09733b4b1 /src/google_breakpad/processor | |
parent | Breakpad Linux dumper: STABS reader incorrectly assumes a single compilation ... (diff) | |
download | breakpad-2684b4dc196ca2da9466aa5391f5c0090739d2f6.tar.xz |
Breakpad processor: Don't pass Windows stack walking information to all walkers.
At the moment, the StackWalker GetCallerFrame member function expects
a vector of WindowsFrameInfo structures, even though WindowsFrameInfo
is only used or useful on one one implementation (StackWalkerX86).
This patch changes StackWalker::GetCallerFrame to no longer expect the
WindowsFrameInfo structures, and changes all implementations to match.
In particular, StackWalkerX86 is changed to find the WindowsFrameInfo
data itself, and store a pointer to whatever it got in the StackFrame
object itself (which is really a StackFrameX86).
To allow GetCallerFrame implementations to look up stack walking data,
StackWalker::resolver_ needs to be made protected, not private.
a=jimblandy, r=mmentovai
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@491 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r-- | src/google_breakpad/processor/stack_frame_cpu.h | 11 | ||||
-rw-r--r-- | src/google_breakpad/processor/stackwalker.h | 13 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/google_breakpad/processor/stack_frame_cpu.h b/src/google_breakpad/processor/stack_frame_cpu.h index 1e414638..8963f6ff 100644 --- a/src/google_breakpad/processor/stack_frame_cpu.h +++ b/src/google_breakpad/processor/stack_frame_cpu.h @@ -44,6 +44,8 @@ namespace google_breakpad { +struct WindowsFrameInfo; + struct StackFrameX86 : public StackFrame { // ContextValidity has one entry for each relevant hardware pointer register // (%eip and %esp) and one entry for each nonvolatile (callee-save) register. @@ -74,7 +76,9 @@ struct StackFrameX86 : public StackFrame { StackFrameX86() : context(), context_validity(CONTEXT_VALID_NONE), - trust(FRAME_TRUST_NONE) {} + trust(FRAME_TRUST_NONE), + windows_frame_info(NULL) {} + ~StackFrameX86(); // Register state. This is only fully valid for the topmost frame in a // stack. In other frames, the values of nonvolatile registers may be @@ -90,6 +94,11 @@ struct StackFrameX86 : public StackFrame { // Amount of trust the stack walker has in the instruction pointer // of this frame. FrameTrust trust; + + // Any stack walking information we found describing + // this.instruction. These may be NULL if we couldn't find the + // appropriate information. + WindowsFrameInfo *windows_frame_info; }; struct StackFramePPC : public StackFrame { diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h index 27085585..3b62eacc 100644 --- a/src/google_breakpad/processor/stackwalker.h +++ b/src/google_breakpad/processor/stackwalker.h @@ -48,12 +48,10 @@ namespace google_breakpad { class CallStack; class CodeModules; -template<typename T> class linked_ptr; class MemoryRegion; class MinidumpContext; class SourceLineResolverInterface; struct StackFrame; -struct WindowsFrameInfo; class SymbolSupplier; class SystemInfo; @@ -118,6 +116,10 @@ class Stackwalker { // This field is optional and may be NULL. const CodeModules *modules_; + protected: + // The SourceLineResolver implementation. + SourceLineResolverInterface *resolver_; + private: // Obtains the context frame, the innermost called procedure in a stack // trace. Returns NULL on failure. GetContextFrame allocates a new @@ -133,15 +135,10 @@ class Stackwalker { // the end of the stack has been reached). GetCallerFrame allocates a new // StackFrame (or StackFrame subclass), ownership of which is taken by // the caller. - virtual StackFrame* GetCallerFrame( - const CallStack *stack, - const vector< linked_ptr<WindowsFrameInfo> > &stack_frame_info) = 0; + virtual StackFrame* GetCallerFrame(const CallStack *stack) = 0; // The optional SymbolSupplier for resolving source line info. SymbolSupplier *supplier_; - - // The SourceLineResolver implementation - SourceLineResolverInterface *resolver_; }; |