diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-02-10 21:29:54 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-02-10 21:29:54 +0000 |
commit | a285652cba2851b14b3e7ac29c493b092656064f (patch) | |
tree | 913f49d2eb441403b2eb563c8a646cc2833dcae7 /src/tools | |
parent | Reinstnate the call to TerminateThread inside ExceptionHandler destructor and... (diff) | |
download | breakpad-a285652cba2851b14b3e7ac29c493b092656064f.tar.xz |
Issue 275: patch to include list of loaded modules in crash_report output
Written by: jum@mac.com
R=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@310 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/mac/crash_report/crash_report.mm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tools/mac/crash_report/crash_report.mm b/src/tools/mac/crash_report/crash_report.mm index c291c13d..f90ee42f 100644 --- a/src/tools/mac/crash_report/crash_report.mm +++ b/src/tools/mac/crash_report/crash_report.mm @@ -190,6 +190,36 @@ static void PrintRegisters(const CallStack *stack, const string &cpu) { printf("\n"); } +static void PrintModules(const CodeModules *modules) { + if (!modules) + return; + + printf("\n"); + printf("Loaded modules:\n"); + + u_int64_t main_address = 0; + const CodeModule *main_module = modules->GetMainModule(); + if (main_module) { + main_address = main_module->base_address(); + } + + unsigned int module_count = modules->module_count(); + for (unsigned int module_sequence = 0; + module_sequence < module_count; + ++module_sequence) { + const CodeModule *module = modules->GetModuleAtSequence(module_sequence); + assert(module); + u_int64_t base_address = module->base_address(); + printf("0x%08llx - 0x%08llx %s %s%s %s\n", + base_address, base_address + module->size() - 1, + PathnameStripper::File(module->code_file()).c_str(), + module->version().empty() ? "???" : module->version().c_str(), + main_module != NULL && base_address == main_address ? + " (main)" : "", + module->code_file().c_str()); + } +} + //============================================================================= static void Start(Options *options) { string minidump_file([options->minidumpPath fileSystemRepresentation]); @@ -258,6 +288,9 @@ static void Start(Options *options) { printf("\nThread %d:", requesting_thread); PrintRegisters(process_state.threads()->at(requesting_thread), cpu); } + + // Print information about modules + PrintModules(process_state.modules()); } //============================================================================= |