From 08ecfb3b6cd42d3decda571888b2cae39ded4e47 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sat, 30 Mar 2024 15:32:23 +0100 Subject: [PATCH] stepping working --- src/debugger/debugger.cpp | 6 ++++- src/dummy.cpp | 6 ++--- uae_src/debug.cpp | 56 +++++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/debugger/debugger.cpp b/src/debugger/debugger.cpp index ed9ae835..c7cd572c 100644 --- a/src/debugger/debugger.cpp +++ b/src/debugger/debugger.cpp @@ -21,6 +21,8 @@ extern DebuggerAPI s_debugger_api; static Debugger* s_debugger = nullptr; +extern void debug_internal_step(); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Debugger* Debugger_create() { @@ -350,6 +352,7 @@ static void update(void* self) { if (e.key.keysym.sym == SDLK_F10) { Debugger_step(s_debugger); + return; } break; @@ -365,9 +368,10 @@ static void update(void* self) { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void Debugger_step(Debugger* debugger) { - + debug_internal_step(); } +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static void live_update(void* self) { } static void destroy(void* self) { } diff --git a/src/dummy.cpp b/src/dummy.cpp index 0db1c43c..d98b45d9 100644 --- a/src/dummy.cpp +++ b/src/dummy.cpp @@ -142,7 +142,7 @@ static void dummy_close(void) { // Dummy function to acquire an input device static int dummy_acquire(int device_id, int exclusive) { - UNIMPLEMENTED(); + //UNIMPLEMENTED(); return 0; // Return 0 for success, -1 for failure } @@ -1534,11 +1534,11 @@ int target_get_volume_name(uaedev_mount_info*, uaedev_config_info*, bool, bool, #endif void target_inputdevice_acquire() { - UNIMPLEMENTED(); + //UNIMPLEMENTED(); } void target_inputdevice_unacquire() { - UNIMPLEMENTED(); + //UNIMPLEMENTED(); } bool target_isrelativemode() { diff --git a/uae_src/debug.cpp b/uae_src/debug.cpp index 747d2226..8ab1fcd1 100644 --- a/uae_src/debug.cpp +++ b/uae_src/debug.cpp @@ -55,7 +55,7 @@ #include "keybuf.h" static int trace_mode; -static uae_u32 trace_param[3]; +uae_u32 trace_param[3]; int debugger_active; static int debug_rewind; @@ -7191,23 +7191,32 @@ static void debug_1 (void) nxdis = nextpc; nxmem = 0; debugger_active = 1; - for (;;) { - int v; - - if (!debugger_active) - return; - update_debug_info (); - console_out (_T(">")); - console_flush (); - debug_linecounter = 0; - v = console_get (input, MAX_LINEWIDTH); - if (v < 0) - return; - if (v == 0) - continue; - if (debug_line (input)) - return; +#if DEBUGGER_API_ENABLE + if (DebuggerAPI_has_debugger()) { + DebuggerAPI_update(); + return; + } else { +#endif + for (;;) { + int v; + + if (!debugger_active) + return; + update_debug_info (); + console_out (_T(">")); + console_flush (); + debug_linecounter = 0; + v = console_get (input, MAX_LINEWIDTH); + if (v < 0) + return; + if (v == 0) + continue; + if (debug_line (input)) + return; + } +#if DEBUGGER_API_ENABLE } +#endif } static void addhistory(void) @@ -7340,12 +7349,6 @@ void debug (void) { int wasactive; -#if DEBUGGER_API_ENABLE - if (DebuggerAPI_has_debugger()) { - DebuggerAPI_update(); - return; - } -#endif if (savestate_state) return; @@ -8802,3 +8805,10 @@ bool debug_sprintf(uaecptr addr, uae_u32 val, int size) } return true; } + +void debug_internal_step() { + no_trace_exceptions = 0; + debug_cycles(2); + trace_param[0] = trace_param[1] = 0; +} +