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.
a9c0550edd
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@74 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
ed61ae0bbd
commit
db3342a10e
36 changed files with 1515 additions and 351 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue