summaryrefslogtreecommitdiffstats
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author Sven Schnelle <svens@stackframe.org>2018-11-06 14:57:00 +0100
committer Sven Schnelle <svens@stackframe.org>2018-11-06 15:44:52 +0100
commit12f43029dce51119c7fba40486c82339f2a9908b (patch)
treef9e38938a8462a076a34c66554797339d35a1a95 /src/emu/debug/debugcmd.cpp
parent25987a5fdc17899dbef5839b5821e5572ae05717 (diff)
debugger: add 'gp' command
gp 'go privilege' starts execution until the privilege mode changes. This can be used to break on task switches. I.e on m68k, one could do: gp { ~sr & 0x2000 && crp_aptr == 0x1234567 } which would execute until the privilege mode changes to user mode and the CPU root pointer is 0x1234567. for cpu code, all that is needed to make this work is calling debugger_privilege_hook() when the execution level changes.
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 4dc4844ae6c..868dfec1fde 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -160,6 +160,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
m_console.register_command("ge", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_exception, this, _1, _2));
m_console.register_command("gtime", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1, _2));
m_console.register_command("gt", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1, _2));
+ m_console.register_command("gp", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_privilege, this, _1, _2));
m_console.register_command("next", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_next, this, _1, _2));
m_console.register_command("n", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_next, this, _1, _2));
m_console.register_command("focus", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_focus, this, _1, _2));
@@ -899,6 +900,19 @@ void debugger_commands::execute_go_time(int ref, const std::vector<std::string>
}
+
+/*-------------------------------------------------
+ execute_go_privilege - execute the gp command
+-------------------------------------------------*/
+void debugger_commands::execute_go_privilege(int ref, const std::vector<std::string> &params)
+{
+ parsed_expression condition(&m_cpu.get_visible_cpu()->debug()->symtable());
+ if (params.size() > 0 && !debug_command_parameter_expression(params[0], condition))
+ return;
+
+ m_cpu.get_visible_cpu()->debug()->go_privilege((condition.is_empty()) ? "1" : condition.original_string());
+}
+
/*-------------------------------------------------
execute_next - execute the next command
-------------------------------------------------*/