[PATCH 1/4] Repeat CPU & DSP "step" and "next" commands on Enter

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


---
 doc/release-notes.txt | 1 +
 src/debug/debugcpu.c  | 6 +++---
 src/debug/debugdsp.c  | 6 +++---
 src/debug/debugui.c   | 4 +++-
 src/debug/debugui.h   | 3 ++-
 5 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/doc/release-notes.txt b/doc/release-notes.txt
index 430c5c9e..f1dd4c0e 100644
--- a/doc/release-notes.txt
+++ b/doc/release-notes.txt
@@ -44,6 +44,7 @@ Emulator:
 - GEMDOS HD:
   - Fix: clear GEMDOS Fread / Fwrite errors
 - Debugger:
+  - Repeat CPU & DSP "step" and "next" commands on Enter
   - More readable "variables" command output
   - Add "info vme" command
   - Add "scc" and "vme" (VME/SCU reg access) tracing support
diff --git a/src/debug/debugcpu.c b/src/debug/debugcpu.c
index 84f0d7d9..4f7c1fe5 100644
--- a/src/debug/debugcpu.c
+++ b/src/debug/debugcpu.c
@@ -710,7 +710,7 @@ static int DebugCpu_Continue(int nArgc, char *psArgv[])
 static int DebugCpu_Step(int nArgc, char *psArgv[])
 {
 	nCpuSteps = 1;
-	return DEBUGGER_END;
+	return DEBUGGER_ENDCONT;
 }
 
 
@@ -808,14 +808,14 @@ static int DebugCpu_Next(int nArgc, char *psArgv[])
 		else
 		{
 			nCpuSteps = 1;
-			return DEBUGGER_END;
+			return DEBUGGER_ENDCONT;
 		}
 	}
 	/* use breakpoint, not steps */
 	if (BreakCond_Command(command, false))
 	{
 		nCpuSteps = 0;
-		return DEBUGGER_END;
+		return DEBUGGER_ENDCONT;
 	}
 	return DEBUGGER_CMDDONE;
 }
diff --git a/src/debug/debugdsp.c b/src/debug/debugdsp.c
index 01461115..e7cb04d4 100644
--- a/src/debug/debugdsp.c
+++ b/src/debug/debugdsp.c
@@ -309,7 +309,7 @@ static int DebugDsp_Continue(int nArgc, char *psArgv[])
 static int DebugDsp_Step(int nArgc, char *psArgv[])
 {
 	nDspSteps = 1;
-	return DEBUGGER_END;
+	return DEBUGGER_ENDCONT;
 }
 
 
@@ -391,7 +391,7 @@ static int DebugDsp_Next(int nArgc, char *psArgv[])
 		if (optype != CALL_SUBROUTINE && optype != CALL_EXCEPTION)
 		{
 			nDspSteps = 1;
-			return DEBUGGER_END;
+			return DEBUGGER_ENDCONT;
 		}
 
 		nextpc = DSP_GetNextPC(DSP_GetPC());
@@ -400,7 +400,7 @@ static int DebugDsp_Next(int nArgc, char *psArgv[])
 	/* use breakpoint, not steps */
 	if (BreakCond_Command(command, true)) {
 		nDspSteps = 0;
-		return DEBUGGER_END;
+		return DEBUGGER_ENDCONT;
 	}
 	return DEBUGGER_CMDDONE;
 }
diff --git a/src/debug/debugui.c b/src/debug/debugui.c
index 5def12a0..58d4774a 100644
--- a/src/debug/debugui.c
+++ b/src/debug/debugui.c
@@ -658,10 +658,12 @@ static int DebugUI_ParseCommand(const char *input_orig)
 		retval = debugCommand[i].pFunction(nArgc, psArgs);
 	}
 	/* Save commando string if it can be repeated */
-	if (retval == DEBUGGER_CMDCONT)
+	if (retval == DEBUGGER_CMDCONT || retval == DEBUGGER_ENDCONT)
 	{
 		if (psArgs[0] != sLastCmd)
 			strlcpy(sLastCmd, psArgs[0], sizeof(sLastCmd));
+		if (retval == DEBUGGER_ENDCONT)
+			retval = DEBUGGER_END;
 	}
 	else
 		sLastCmd[0] = '\0';
diff --git a/src/debug/debugui.h b/src/debug/debugui.h
index 3a87b947..2f30d101 100644
--- a/src/debug/debugui.h
+++ b/src/debug/debugui.h
@@ -13,7 +13,8 @@
 /* DebugUI_ParseCommand() return values */
 enum {
 	DEBUGGER_END,      // Leave debugger
-	DEBUGGER_CMDCONT,  // Command can continue
+	DEBUGGER_ENDCONT,  // Command can be repeated + leaves debugger
+	DEBUGGER_CMDCONT,  // Command can be repeated
 	DEBUGGER_CMDDONE   // Command done
 };
 
-- 
2.20.1


--------------4023024045B6B32B00F42206
Content-Type: text/x-patch; charset=UTF-8;
 name="0002-Mark-the-line-in-CPU-DSP-disassembly-matching-PC.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0002-Mark-the-line-in-CPU-DSP-disassembly-matching-PC.patch"



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/