diff options
-rw-r--r-- | src/emu/debug/debugcmd.cpp | 16 | ||||
-rw-r--r-- | src/emu/debug/debugcmd.h | 1 | ||||
-rw-r--r-- | src/emu/debug/debughlp.cpp | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index cd9d9dcf743..fa877cafd34 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -169,6 +169,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu m_console.register_command("observe", CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_observe, this, _1, _2)); m_console.register_command("suspend", CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_suspend, this, _1, _2)); m_console.register_command("resume", CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, std::bind(&debugger_commands::execute_resume, this, _1, _2)); + m_console.register_command("cpulist", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_cpulist, this, _1, _2)); m_console.register_command("comadd", CMDFLAG_NONE, 0, 1, 2, std::bind(&debugger_commands::execute_comment_add, this, _1, _2)); m_console.register_command("//", CMDFLAG_NONE, 0, 1, 2, std::bind(&debugger_commands::execute_comment_add, this, _1, _2)); @@ -1178,6 +1179,21 @@ void debugger_commands::execute_resume(int ref, const std::vector<std::string> & } } +//------------------------------------------------- +// execute_cpulist - list all CPUs +//------------------------------------------------- + +void debugger_commands::execute_cpulist(int ref, const std::vector<std::string> ¶ms) +{ + int index = 0; + for (device_execute_interface &exec : execute_interface_iterator(m_machine.root_device())) + { + device_state_interface *state; + if (exec.device().interface(state) && state->state_find_entry(STATE_GENPCBASE) != nullptr) + m_console.printf("[%s%d] %s\n", &exec.device() == m_cpu.get_visible_cpu() ? "*" : "", index++, exec.device().tag()); + } +} + /*------------------------------------------------- execute_comment - add a comment to a line -------------------------------------------------*/ diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index 862ad93a45a..74da262bfdd 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -115,6 +115,7 @@ private: void execute_suspend(int ref, const std::vector<std::string> ¶ms); void execute_resume(int ref, const std::vector<std::string> ¶ms); void execute_next(int ref, const std::vector<std::string> ¶ms); + void execute_cpulist(int ref, const std::vector<std::string> ¶ms); void execute_comment_add(int ref, const std::vector<std::string> ¶ms); void execute_comment_del(int ref, const std::vector<std::string> ¶ms); void execute_comment_save(int ref, const std::vector<std::string> ¶ms); diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index d737c0376aa..81885ab51e8 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -147,6 +147,7 @@ static const help_item static_help_list[] = " observe [<CPU>[,<CPU>[,...]]] -- resumes debugging on <CPU>\n" " suspend [<CPU>[,<CPU>[,...]]] -- suspends execution on <CPU>\n" " resume [<CPU>[,<CPU>[,...]]] -- resumes execution on <CPU>\n" + " cpulist -- list all CPUs\n" " trace {<filename>|OFF}[,<CPU>[,<detectloops>[,<action>]]] -- trace the given CPU to a file (defaults to active CPU)\n" " traceover {<filename>|OFF}[,<CPU>[,<detectloops>[,<action>]]] -- trace the given CPU to a file, but skip subroutines (defaults to active CPU)\n" " traceflush -- flushes all open trace files\n" |