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
322 {322 {
323 auto msg = std::stringstream{};323 auto msg = std::stringstream{};
324 msg << "Modules:\n";324 msg << "Modules:\n";
325 for (auto m : cxt.vm.get_loaded_modules())325
326 msg << " " << m->module_name->str() << "\n";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 });
327 334
328 debug_print_info(msg.str());335 debug_print_info(msg.str());
329 }336 }
@@ -625,7 +632,7 @@ namespace · 295 unmodified lines
625 { "r", "Print registers", nullptr, nullptr, cmd_print_registers },632 { "r", "Print registers", nullptr, nullptr, cmd_print_registers },
626 { "t", "Print all threads", nullptr, nullptr, cmd_print_threads },633 { "t", "Print all threads", nullptr, nullptr, cmd_print_threads },
627 { "m", "Print all loaded modules", nullptr, nullptr, cmd_print_modules },634 { "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 },
629 { "st", "Switch to thread", "st [0-9]+", "st 42", cmd_switchthread },636 { "st", "Switch to thread", "st [0-9]+", "st 42", cmd_switchthread },
630 { "d", "Disassemble the next/previous N instructions", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },637 { "d", "Disassemble the next/previous N instructions", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },
631 { "x", "Examine memory", "x [mp|fp] [0-9]+ ([0-9]+)?", "x mp 3, x fp 20 6", cmd_examine },638 { "x", "Examine memory", "x [mp|fp] [0-9]+ ([0-9]+)?", "x mp 3, x fp 20 6", cmd_examine },