From 3f8fd3720d38bded32fdf88ed3824f9c8745a4a7 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 24 Apr 2017 20:49:31 -0700 Subject: Fix interaction between 68K debugger and instruction retranslation due to self modifying code or bank switching --- m68k_core.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'm68k_core.h') diff --git a/m68k_core.h b/m68k_core.h index 48a2a90..7773d64 100644 --- a/m68k_core.h +++ b/m68k_core.h @@ -56,13 +56,23 @@ typedef struct { code_ptr get_sr; code_ptr set_sr; code_ptr set_ccr; + code_ptr bp_stub; code_info extra_code; movem_fun *big_movem; uint32_t num_movem; uint32_t movem_storage; + code_word prologue_start; } m68k_options; -typedef struct m68k_context { +typedef struct m68k_context m68k_context; +typedef void (*m68k_debug_handler)(m68k_context *context, uint32_t pc); + +typedef struct { + m68k_debug_handler handler; + uint32_t address; +} m68k_breakpoint; + +struct m68k_context { uint8_t flags[5]; uint8_t status; uint16_t int_ack; @@ -79,14 +89,17 @@ typedef struct m68k_context { code_ptr reset_handler; m68k_options *options; void *system; + m68k_breakpoint *breakpoints; + uint32_t num_breakpoints; + uint32_t bp_storage; uint8_t int_pending; uint8_t trace_pending; uint8_t should_return; uint8_t ram_code_flags[]; -} m68k_context; +}; typedef m68k_context *(*m68k_reset_handler)(m68k_context *context); -typedef m68k_context *(*m68k_debug_handler)(m68k_context *context, uint32_t pc); + void translate_m68k_stream(uint32_t address, m68k_context * context); void start_68k_context(m68k_context * context, uint32_t address); -- cgit v1.2.3