diff options
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 |
commit | 12f43029dce51119c7fba40486c82339f2a9908b (patch) | |
tree | f9e38938a8462a076a34c66554797339d35a1a95 /src/emu/debug/debugcpu.h | |
parent | 25987a5fdc17899dbef5839b5821e5572ae05717 (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/debugcpu.h')
-rw-r--r-- | src/emu/debug/debugcpu.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 2244b6ccb42..e887c3244ed 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -181,6 +181,7 @@ public: void stop_hook(); void interrupt_hook(int irqline); void exception_hook(int exception); + void privilege_hook(); void instruction_hook(offs_t curpc); // hooks into our operations @@ -205,6 +206,7 @@ public: void go_interrupt(int irqline = -1); void go_exception(int exception); void go_milliseconds(u64 milliseconds); + void go_privilege(const char *condition); void go_next_device(); template <typename Format, typename... Params> @@ -324,6 +326,7 @@ private: attotime m_stoptime; // stop time for DEBUG_FLAG_STOP_TIME int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION + std::unique_ptr<parsed_expression> m_privilege_condition; // expression to evaluate on privilege change attotime m_endexectime; // ending time of the current execution u64 m_total_cycles; // current total cycles u64 m_last_total_cycles; // last total cycles @@ -459,11 +462,13 @@ private: static constexpr u32 DEBUG_FLAG_STOP_TIME = 0x00002000; // there is a pending stop at cpu->stoptime static constexpr u32 DEBUG_FLAG_SUSPENDED = 0x00004000; // CPU currently suspended static constexpr u32 DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU + static constexpr u32 DEBUG_FLAG_STOP_PRIVILEGE = 0x00020000; // run until execution level changes static constexpr u32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT; static constexpr u32 DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER; static constexpr u32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | - DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | DEBUG_FLAG_STOP_TIME; + DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | + DEBUG_FLAG_STOP_TIME | DEBUG_FLAG_STOP_PRIVILEGE; }; //************************************************************************** |