From 2213d5b1536528211938bdbff539188edd0af028 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 23 Nov 2014 17:20:02 +0200 Subject: [PATCH] Do not exit CPU stopped state when in debugger. --- debug.cpp | 13 +++++++++---- newcpu.cpp | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debug.cpp b/debug.cpp index 241483ec..954d176f 100644 --- a/debug.cpp +++ b/debug.cpp @@ -4578,6 +4578,12 @@ static void addhistory (void) } } +static void debug_continue(void) +{ + set_special (SPCFLAG_BRK); +} + + void debug (void) { int i; @@ -4683,7 +4689,7 @@ void debug (void) } } if (!bp) { - set_special (SPCFLAG_BRK); + debug_continue(); return; } } @@ -4701,7 +4707,7 @@ void debug (void) if (skipaddr_doskip > 0) { skipaddr_doskip--; if (skipaddr_doskip > 0) { - set_special (SPCFLAG_BRK); + debug_continue(); return; } } @@ -4744,8 +4750,7 @@ void debug (void) do_skip = 1; if (do_skip) { set_special (SPCFLAG_BRK); - m68k_resumestopped (); - debugging = 1; + debugging = -1; } resume_sound (); inputdevice_acquire (TRUE); diff --git a/newcpu.cpp b/newcpu.cpp index a3ef6186..f6c41afb 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -3500,9 +3500,9 @@ static int do_specialties (int cycles) unset_special (SPCFLAG_TRAP); Exception (3); } - while ((regs.spcflags & SPCFLAG_STOP) && !(regs.spcflags & SPCFLAG_BRK)) { +isstopped: if (uae_int_requested || uaenet_int_requested) { INTREQ_f (0x8008); set_special (SPCFLAG_INT); @@ -3619,8 +3619,11 @@ static int do_specialties (int cycles) if (regs.spcflags & SPCFLAG_BRK) { unset_special(SPCFLAG_BRK); #ifdef DEBUGGER - if (debugging) + if (debugging) { debug(); + if (regs.stopped) + goto isstopped; + } #endif } -- 2.47.3