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
This commit is contained in:
@@ -75,6 +75,14 @@ ProcessState* MinidumpProcessor::Process(const string &minidump_file) {
|
||||
&dump, &process_state->crash_address_);
|
||||
}
|
||||
|
||||
MinidumpModuleList *module_list = dump.GetModuleList();
|
||||
|
||||
// Put a copy of the module list into ProcessState object. This is not
|
||||
// necessarily a MinidumpModuleList, but it adheres to the CodeModules
|
||||
// interface, which is all that ProcessState needs to expose.
|
||||
if (module_list)
|
||||
process_state->modules_ = module_list->Copy();
|
||||
|
||||
MinidumpThreadList *threads = dump.GetThreadList();
|
||||
if (!threads) {
|
||||
return NULL;
|
||||
@@ -137,10 +145,18 @@ ProcessState* MinidumpProcessor::Process(const string &minidump_file) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Use process_state->modules_ instead of module_list, because the
|
||||
// |modules| argument will be used to populate the |module| fields in
|
||||
// the returned StackFrame objects, which will be placed into the
|
||||
// returned ProcessState object. module_list's lifetime is only as
|
||||
// long as the Minidump object: it will be deleted when this function
|
||||
// returns. process_state->modules_ is owned by the ProcessState object
|
||||
// (just like the StackFrame objects), and is much more suitable for this
|
||||
// task.
|
||||
scoped_ptr<Stackwalker> stackwalker(
|
||||
Stackwalker::StackwalkerForCPU(context,
|
||||
thread_memory,
|
||||
dump.GetModuleList(),
|
||||
process_state->modules_,
|
||||
supplier_));
|
||||
if (!stackwalker.get()) {
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user