aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/mac/crash_report/crash_report.mm33
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());
}
//=============================================================================