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/source_line_resolver.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/source_line_resolver.cc')
-rw-r--r-- | src/processor/source_line_resolver.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/processor/source_line_resolver.cc b/src/processor/source_line_resolver.cc index 66e31288..1ebc1bf4 100644 --- a/src/processor/source_line_resolver.cc +++ b/src/processor/source_line_resolver.cc @@ -39,6 +39,7 @@ #include "processor/range_map-inl.h" #include "processor/source_line_resolver.h" +#include "google_airbag/processor/code_module.h" #include "google_airbag/processor/stack_frame.h" #include "processor/linked_ptr.h" #include "processor/scoped_ptr.h" @@ -111,7 +112,7 @@ class SourceLineResolver::Module { // returned. If no additional information is available, returns NULL. // A NULL return value is not an error. The caller takes ownership of // any returned StackFrameInfo object. - StackFrameInfo* LookupAddress(MemAddr address, StackFrame *frame) const; + StackFrameInfo* LookupAddress(StackFrame *frame) const; private: friend class SourceLineResolver; @@ -206,10 +207,11 @@ bool SourceLineResolver::HasModule(const string &module_name) const { StackFrameInfo* SourceLineResolver::FillSourceLineInfo( StackFrame *frame) const { - ModuleMap::const_iterator it = modules_->find(frame->module_name); - if (it != modules_->end()) { - return it->second->LookupAddress(frame->instruction - frame->module_base, - frame); + if (frame->module) { + ModuleMap::const_iterator it = modules_->find(frame->module->code_file()); + if (it != modules_->end()) { + return it->second->LookupAddress(frame); + } } return NULL; } @@ -273,8 +275,10 @@ bool SourceLineResolver::Module::LoadMap(const string &map_file) { return true; } -StackFrameInfo* SourceLineResolver::Module::LookupAddress( - MemAddr address, StackFrame *frame) const { +StackFrameInfo* SourceLineResolver::Module::LookupAddress(StackFrame *frame) + const { + MemAddr address = frame->instruction - frame->module->base_address(); + linked_ptr<StackFrameInfo> retrieved_info; // Check for debugging info first, before any possible early returns. // @@ -318,7 +322,7 @@ StackFrameInfo* SourceLineResolver::Module::LookupAddress( parameter_size = func->parameter_size; frame->function_name = func->name; - frame->function_base = frame->module_base + function_base; + frame->function_base = frame->module->base_address() + function_base; linked_ptr<Line> line; MemAddr line_base; @@ -328,7 +332,7 @@ StackFrameInfo* SourceLineResolver::Module::LookupAddress( frame->source_file_name = files_.find(line->source_file_id)->second; } frame->source_line = line->line; - frame->source_line_base = frame->module_base + line_base; + frame->source_line_base = frame->module->base_address() + line_base; } } else if (public_symbols_.Retrieve(address, &public_symbol, &public_address) && @@ -336,7 +340,7 @@ StackFrameInfo* SourceLineResolver::Module::LookupAddress( parameter_size = public_symbol->parameter_size; frame->function_name = public_symbol->name; - frame->function_base = frame->module_base + public_address; + frame->function_base = frame->module->base_address() + public_address; } else { // No FUNC or PUBLIC data available. return frame_info.release(); |