From d119a921ea611dc38cfcb7411759ddf2c688603f Mon Sep 17 00:00:00 2001 From: mmentovai Date: Mon, 23 Oct 2006 19:24:58 +0000 Subject: Make stack_frame_info vector hold linked_ptrs instead of objects; make Stackwalker::Walk create and return a CallStack instead of filling a caller-supplied one (#54). r=bryner Interface change: Stackwalker::Walk and MinidumpProcessor::Process now return a new CallStack*. http://groups.google.com/group/airbag-dev/browse_thread/thread/d2bad5d7c115c3fe git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@45 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/stackwalker.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/processor/stackwalker.h') diff --git a/src/processor/stackwalker.h b/src/processor/stackwalker.h index d4eb0745..82421bb5 100644 --- a/src/processor/stackwalker.h +++ b/src/processor/stackwalker.h @@ -43,25 +43,28 @@ #include -#include "processor/stack_frame_info.h" - namespace google_airbag { class CallStack; +template class linked_ptr; class MemoryRegion; class MinidumpContext; class MinidumpModuleList; struct StackFrame; +struct StackFrameInfo; class SymbolSupplier; +using std::vector; + class Stackwalker { public: virtual ~Stackwalker() {} - // Fills the given CallStack by calling GetContextFrame and GetCallerFrame, - // and populating the returned frames with all available data. - void Walk(CallStack* stack); + // Creates a new CallStack and populates it by calling GetContextFrame and + // GetCallerFrame. The frames are further processed to fill all available + // data. The caller takes ownership of the CallStack returned by Walk. + CallStack* Walk(); // Returns a new concrete subclass suitable for the CPU that a stack was // generated on, according to the CPU type indicated by the context @@ -86,11 +89,6 @@ class Stackwalker { // get information from the stack. MemoryRegion *memory_; - // Additional debugging information for each stack frame. This vector - // parallels the CallStack. Subclasses may use this information to help - // walk the stack. - std::vector stack_frame_info_; - private: // Obtains the context frame, the innermost called procedure in a stack // trace. Returns NULL on failure. GetContextFrame allocates a new @@ -106,7 +104,9 @@ 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) = 0; + virtual StackFrame* GetCallerFrame( + const CallStack *stack, + const vector< linked_ptr > &stack_frame_info) = 0; // A list of modules, for populating each StackFrame's module information. // This field is optional and may be NULL. -- cgit v1.2.1