History

Expose the loaded path of a module from the VM. Display path for the loaded module in the debugger.

arr committed 10 years ago

Commit 42194721 parent 836214e4 files · +47 −57Browse files

Showing the changes to src/exec/debugger.cpp (1 of 4 files). Show all

Unified · Split

src/exec/debugger.cpp+10−3
@@ -322,8 +322,15 @@ namespace · 321 unmodified lines
322322 {
323323 auto msg = std::stringstream{};
324324 msg << "Modules:\n";
325− for (auto m : cxt.vm.get_loaded_modules())
326− msg << " " << m->module_name->str() << "\n";
325+
326+ cxt.vm.enum_loaded_modules([&msg](const loaded_vm_module_t &m)
327+ {
328+ auto module_instance = m.module.lock();
329+ if (module_instance == nullptr)
330+ return;
331+
332+ msg << std::setw(24) << module_instance->module_name->str() << std::setw(0) << " " << m.origin->str() << "\n";
333+ });
327334
328335 debug_print_info(msg.str());
329336 }
@@ -625,7 +632,7 @@ namespace · 295 unmodified lines
625632 { "r", "Print registers", nullptr, nullptr, cmd_print_registers },
626633 { "t", "Print all threads", nullptr, nullptr, cmd_print_threads },
627634 { "m", "Print all loaded modules", nullptr, nullptr, cmd_print_modules },
628− { "sw", "Stack walk/back trace", "bt ([0-9]+|\\*)?", "bt, bt 34, bt *", cmd_stacktrace },
635+ { "bt", "Stack walk/back trace for the current or supplied thread", "bt ([0-9]+|\\*)?", "bt, bt 34, bt *", cmd_stacktrace },
629636 { "st", "Switch to thread", "st [0-9]+", "st 42", cmd_switchthread },
630637 { "d", "Disassemble the next/previous N instructions", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },
631638 { "x", "Examine memory", "x [mp|fp] [0-9]+ ([0-9]+)?", "x mp 3, x fp 20 6", cmd_examine },