[PATCH 3/3] Repeat "step" and "next" commands on Enter |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- Subject: [PATCH 3/3] Repeat "step" and "next" commands on Enter
- From: Eero Tamminen <oak@xxxxxxxxxxxxxx>
- Date: Mon, 6 Sep 2021 23:02:19 +0300
---
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..98a29f98 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 "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 972d064e..82e2e233 100644
--- a/src/debug/debugcpu.c
+++ b/src/debug/debugcpu.c
@@ -721,7 +721,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;
}
@@ -819,14 +819,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
--------------813F85CE7FBFE7F2627A59B8
Content-Type: text/x-patch; charset=UTF-8;
name="0002-Mark-the-line-in-disassembly-matching-PC.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="0002-Mark-the-line-in-disassembly-matching-PC.patch"