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
This commit is contained in:
jimblandy
2010-01-14 19:17:36 +00:00
parent 5251e64f48
commit 2684b4dc19
13 changed files with 51 additions and 69 deletions

View File

@@ -47,7 +47,6 @@
#include "processor/linked_ptr.h"
#include "processor/logging.h"
#include "processor/scoped_ptr.h"
#include "processor/windows_frame_info.h"
#include "processor/stackwalker_ppc.h"
#include "processor/stackwalker_sparc.h"
#include "processor/stackwalker_x86.h"
@@ -65,8 +64,8 @@ Stackwalker::Stackwalker(const SystemInfo *system_info,
: system_info_(system_info),
memory_(memory),
modules_(modules),
supplier_(supplier),
resolver_(resolver) {
resolver_(resolver),
supplier_(supplier) {
}
@@ -75,11 +74,6 @@ bool Stackwalker::Walk(CallStack *stack) {
assert(stack);
stack->Clear();
// stack_frame_info parallels the CallStack. The vector is passed to the
// GetCallerFrame function. It contains information that may be helpful
// for stackwalking.
vector< linked_ptr<WindowsFrameInfo> > stack_frame_info;
// Begin with the context frame, and keep getting callers until there are
// no more.
@@ -91,8 +85,6 @@ bool Stackwalker::Walk(CallStack *stack) {
// frame_pointer fields. The frame structure comes from either the
// context frame (above) or a caller frame (below).
linked_ptr<WindowsFrameInfo> frame_info;
// Resolve the module information, if a module map was provided.
if (modules_) {
const CodeModule *module =
@@ -119,7 +111,6 @@ bool Stackwalker::Walk(CallStack *stack) {
}
}
resolver_->FillSourceLineInfo(frame.get());
frame_info.reset(resolver_->FindWindowsFrameInfo(frame.get()));
}
}
@@ -127,12 +118,8 @@ bool Stackwalker::Walk(CallStack *stack) {
// over the frame, because the stack now owns it.
stack->frames_.push_back(frame.release());
// Add the frame info to the parallel stack.
stack_frame_info.push_back(frame_info);
frame_info.reset(NULL);
// Get the next frame and take ownership.
frame.reset(GetCallerFrame(stack, stack_frame_info));
frame.reset(GetCallerFrame(stack));
}
return true;