aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump_processor.cc
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-05 22:52:28 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-12-05 22:52:28 +0000
commitdb3342a10ec30902aa9018b80e1d9a40bd01c487 (patch)
tree933903715ae6d5d5f1b7827e0612314162b0aecf /src/processor/minidump_processor.cc
parentDon't use CRT in exception handler code (#86). r=bryner (diff)
downloadbreakpad-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/minidump_processor.cc')
-rw-r--r--src/processor/minidump_processor.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc
index f9f8066a..d2c44159 100644
--- a/src/processor/minidump_processor.cc
+++ b/src/processor/minidump_processor.cc
@@ -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;