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
This commit is contained in:
nealsid 2009-02-10 21:29:54 +00:00
parent c9944d96e8
commit a285652cba

View File

@ -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());
}
//=============================================================================