Skip to content

Commit

Permalink
stepping working
Browse files Browse the repository at this point in the history
  • Loading branch information
emoon committed Mar 30, 2024
1 parent b105bd8 commit 08ecfb3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
6 changes: 5 additions & 1 deletion src/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extern DebuggerAPI s_debugger_api;

static Debugger* s_debugger = nullptr;

extern void debug_internal_step();

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Debugger* Debugger_create() {
Expand Down Expand Up @@ -350,6 +352,7 @@ static void update(void* self) {

if (e.key.keysym.sym == SDLK_F10) {
Debugger_step(s_debugger);
return;
}

break;
Expand All @@ -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) { }
Expand Down
6 changes: 3 additions & 3 deletions src/dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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() {
Expand Down
56 changes: 33 additions & 23 deletions uae_src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 08ecfb3

Please sign in to comment.