summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
-rw-r--r--src/emu/debug/debugcpu.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 3ebd9951a8a..d668b826261 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -1513,7 +1513,7 @@ void device_debug::interrupt_hook(int irqline)
void device_debug::exception_hook(int exception)
{
- // see if this matches a pending interrupt request
+ // see if this matches an exception breakpoint
if ((m_flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (m_stopexception == -1 || m_stopexception == exception))
{
m_device.machine().debugger().cpu().set_execution_stopped();
@@ -1524,6 +1524,37 @@ void device_debug::exception_hook(int exception)
//-------------------------------------------------
+// privilege_hook - called when privilege level is
+// changed
+//-------------------------------------------------
+
+void device_debug::privilege_hook()
+{
+ bool matched = 1;
+
+ if ((m_flags & DEBUG_FLAG_STOP_PRIVILEGE) != 0)
+ {
+ if (m_privilege_condition && !m_privilege_condition->is_empty())
+ {
+ try
+ {
+ matched = m_privilege_condition->execute();
+ }
+ catch (...)
+ {
+ }
+ }
+
+ if (matched)
+ {
+ m_device.machine().debugger().cpu().set_execution_stopped();
+ m_device.machine().debugger().console().printf("Stopped due to privilege change\n", m_device.tag());
+ compute_debug_flags();
+ }
+ }
+}
+
+//-------------------------------------------------
// instruction_hook - called by the CPU cores
// before executing each instruction
//-------------------------------------------------
@@ -1861,6 +1892,21 @@ void device_debug::go_milliseconds(u64 milliseconds)
//-------------------------------------------------
+// go_privilege - execute until execution
+// level changes
+//-------------------------------------------------
+
+void device_debug::go_privilege(const char *condition)
+{
+ assert(m_exec != nullptr);
+ m_device.machine().rewind_invalidate();
+ m_privilege_condition = std::make_unique<parsed_expression>(&m_symtable, condition);
+ m_flags |= DEBUG_FLAG_STOP_PRIVILEGE;
+ m_device.machine().debugger().cpu().set_execution_running();
+}
+
+
+//-------------------------------------------------
// halt_on_next_instruction_impl - halt in the
// debugger on the next instruction, internal
// implementation which is necessary solely due