Add cpulist command to debugger

This commit is contained in:
AJR 2019-12-07 12:20:07 -05:00
parent df39f376af
commit e50ec3ae1d
3 changed files with 18 additions and 0 deletions

View File

@ -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> &params)
{
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
-------------------------------------------------*/

View File

@ -115,6 +115,7 @@ private:
void execute_suspend(int ref, const std::vector<std::string> &params);
void execute_resume(int ref, const std::vector<std::string> &params);
void execute_next(int ref, const std::vector<std::string> &params);
void execute_cpulist(int ref, const std::vector<std::string> &params);
void execute_comment_add(int ref, const std::vector<std::string> &params);
void execute_comment_del(int ref, const std::vector<std::string> &params);
void execute_comment_save(int ref, const std::vector<std::string> &params);

View File

@ -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"