diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-12-05 22:52:28 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-12-05 22:52:28 +0000 |
commit | db3342a10ec30902aa9018b80e1d9a40bd01c487 (patch) | |
tree | 933903715ae6d5d5f1b7827e0612314162b0aecf /src/processor/stackwalker.cc | |
parent | Don't use CRT in exception handler code (#86). r=bryner (diff) | |
download | breakpad-db3342a10ec30902aa9018b80e1d9a40bd01c487.tar.xz |
Module API (#32). r=waylonis, bryner
- Introduces a standard API for dealing with modules. MinidumpModule
is now a concrete implementation of this API. Code may interact with
single modules using the CodeModule interface, and collections of
modules using its container, the CodeModules interface.
- CodeModule is used directly by SymbolSupplier implementations and
SourceLineResolver. Reliance on the specific implementation in
MinidumpModule has been eliminated.
- Module lists are now added to ProcessState objects. Module references
in each stack frame are now pointers to objects in these module lists.
- The sample minidump_stackwalk tool prints the module list after printing
all threads' stacks.
http://groups.google.com/group/airbag-dev/browse_frm/thread/a9c0550edde54cf8
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@74 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/stackwalker.cc')
-rw-r--r-- | src/processor/stackwalker.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index 78f17363..4e4a6b9f 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -36,6 +36,8 @@ #include "google_airbag/processor/stackwalker.h" #include "google_airbag/processor/call_stack.h" +#include "google_airbag/processor/code_module.h" +#include "google_airbag/processor/code_modules.h" #include "google_airbag/processor/minidump.h" #include "google_airbag/processor/stack_frame.h" #include "google_airbag/processor/symbol_supplier.h" @@ -49,7 +51,7 @@ namespace google_airbag { -Stackwalker::Stackwalker(MemoryRegion *memory, MinidumpModuleList *modules, +Stackwalker::Stackwalker(MemoryRegion *memory, const CodeModules *modules, SymbolSupplier *supplier) : memory_(memory), modules_(modules), supplier_(supplier) { } @@ -80,15 +82,14 @@ CallStack* Stackwalker::Walk() { // Resolve the module information, if a module map was provided. if (modules_) { - MinidumpModule *module = + const CodeModule *module = modules_->GetModuleForAddress(frame->instruction); if (module) { - frame->module_name = *(module->GetName()); - frame->module_base = module->base_address(); - if (!resolver.HasModule(frame->module_name) && supplier_) { + frame->module = module; + if (!resolver.HasModule(frame->module->code_file()) && supplier_) { string symbol_file = supplier_->GetSymbolFile(module); if (!symbol_file.empty()) { - resolver.LoadModule(frame->module_name, symbol_file); + resolver.LoadModule(frame->module->code_file(), symbol_file); } } frame_info.reset(resolver.FillSourceLineInfo(frame.get())); @@ -114,7 +115,7 @@ CallStack* Stackwalker::Walk() { // static Stackwalker* Stackwalker::StackwalkerForCPU(MinidumpContext *context, MemoryRegion *memory, - MinidumpModuleList *modules, + const CodeModules *modules, SymbolSupplier *supplier) { Stackwalker *cpu_stackwalker = NULL; |