[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/30] gdbstub: specialise stub_can_reverse
From: |
Alex Bennée |
Subject: |
[PULL 17/30] gdbstub: specialise stub_can_reverse |
Date: |
Tue, 7 Mar 2023 21:21:26 +0000 |
Currently we only support replay for softmmu mode so it is a constant
false for user-mode.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230302190846.2593720-18-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-18-richard.henderson@linaro.org>
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 26a6468a69..be0eef4850 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -130,6 +130,7 @@ CPUState *gdb_first_attached_cpu(void);
void gdb_append_thread_id(CPUState *cpu, GString *buf);
int gdb_get_cpu_index(CPUState *cpu);
unsigned int gdb_get_max_cpus(void); /* both */
+bool gdb_can_reverse(void); /* softmmu, stub for user */
void gdb_create_default_process(GDBState *s);
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 1b783100c2..7301466ff5 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -113,15 +113,6 @@ int use_gdb_syscalls(void)
return gdb_syscall_mode == GDB_SYS_ENABLED;
}
-static bool stub_can_reverse(void)
-{
-#ifdef CONFIG_USER_ONLY
- return false;
-#else
- return replay_mode == REPLAY_MODE_PLAY;
-#endif
-}
-
/* writes 2*len+1 bytes in buf */
void gdb_memtohex(GString *buf, const uint8_t *mem, int len)
{
@@ -1308,7 +1299,7 @@ static void handle_step(GArray *params, void *user_ctx)
static void handle_backward(GArray *params, void *user_ctx)
{
- if (!stub_can_reverse()) {
+ if (!gdb_can_reverse()) {
gdb_put_packet("E22");
}
if (params->len == 1) {
@@ -1559,7 +1550,7 @@ static void handle_query_supported(GArray *params, void
*user_ctx)
g_string_append(gdbserver_state.str_buf, ";qXfer:features:read+");
}
- if (stub_can_reverse()) {
+ if (gdb_can_reverse()) {
g_string_append(gdbserver_state.str_buf,
";ReverseStep+;ReverseContinue+");
}
diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c
index 3a5587d387..d2863d0663 100644
--- a/gdbstub/softmmu.c
+++ b/gdbstub/softmmu.c
@@ -450,6 +450,11 @@ unsigned int gdb_get_max_cpus(void)
return ms->smp.max_cpus;
}
+bool gdb_can_reverse(void)
+{
+ return replay_mode == REPLAY_MODE_PLAY;
+}
+
/*
* Softmmu specific command helpers
*/
diff --git a/gdbstub/user.c b/gdbstub/user.c
index e10988a62b..3f6183e66a 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -409,6 +409,11 @@ unsigned int gdb_get_max_cpus(void)
return max_cpus;
}
+/* replay not supported for user-mode */
+bool gdb_can_reverse(void)
+{
+ return false;
+}
/*
* Break/Watch point helpers
--
2.39.2
- [PULL 08/30] gdbstub: move fromhex/tohex routines to internals, (continued)
- [PULL 08/30] gdbstub: move fromhex/tohex routines to internals, Alex Bennée, 2023/03/07
- [PULL 07/30] includes: move tb_flush into its own header, Alex Bennée, 2023/03/07
- [PULL 10/30] gdbstub: move chunk of softmmu functionality to own file, Alex Bennée, 2023/03/07
- [PULL 14/30] gdbstub: specialise handle_query_attached, Alex Bennée, 2023/03/07
- [PULL 12/30] gdbstub: rationalise signal mapping in softmmu, Alex Bennée, 2023/03/07
- [PULL 09/30] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/03/07
- [PULL 11/30] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/03/07
- [PULL 02/30] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/03/07
- [PULL 06/30] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/03/07
- [PULL 13/30] gdbstub: abstract target specific details from gdb_put_packet_binary, Alex Bennée, 2023/03/07
- [PULL 17/30] gdbstub: specialise stub_can_reverse,
Alex Bennée <=
- [PULL 26/30] gdbstub: Remove gdb_do_syscallv, Alex Bennée, 2023/03/07
- [PULL 29/30] gdbstub: Build syscall.c once, Alex Bennée, 2023/03/07
- [PULL 28/30] stubs: split semihosting_get_target from system only stubs, Alex Bennée, 2023/03/07
- [PULL 16/30] gdbstub: introduce gdb_get_max_cpus, Alex Bennée, 2023/03/07
- [PULL 25/30] gdbstub: split out softmmu/user specifics for syscall handling, Alex Bennée, 2023/03/07
- [PULL 30/30] gdbstub: move update guest debug to accel ops, Alex Bennée, 2023/03/07
- [PULL 27/30] gdbstub: Adjust gdb_do_syscall to only use uint32_t and uint64_t, Alex Bennée, 2023/03/07
- [PULL 19/30] gdbstub: don't use target_ulong while handling registers, Alex Bennée, 2023/03/07
- [PULL 15/30] gdbstub: specialise target_memory_rw_debug, Alex Bennée, 2023/03/07
- [PULL 20/30] gdbstub: move register helpers into standalone include, Alex Bennée, 2023/03/07