accel: Hold @can_reverse information in AccelGdbConfig

Hold @can_reverse in AccelGdbConfig, set it when initializing
AccelState in AccelClass::init_machine handlers (only TCG sets
it). Remove gdb_can_reverse() as now unused.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-ID: <20260705215729.62196-17-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé committed 2026-07-06 15:42:18 +02:00
1 parent d1286e2933
commit 2aaa8ee7de
6 files changed
+7 -14

No files matched your search

+3
View File
@@ -159,6 +159,9 @@ static int tcg_init_machine(AccelState *as, MachineState *ms)
*/
as->gdbstub.sstep_flags |= SSTEP_NOIRQ | SSTEP_NOTIMER;
}
if (replay_mode == REPLAY_MODE_PLAY) {
as->gdbstub.can_reverse = true;
}
page_init();
tb_htable_init();
+2 -2
View File
@@ -1376,7 +1376,7 @@ static void handle_step(GArray *params, void *user_ctx)
static void handle_backward(GArray *params, void *user_ctx)
{
if (!gdb_can_reverse()) {
if (!gdbserver_state.accel_config.can_reverse) {
gdb_put_packet("E22");
return;
}
@@ -1684,7 +1684,7 @@ static void handle_query_supported(GArray *params, void *user_ctx)
g_string_append(gdbserver_state.str_buf, ";qXfer:features:read+");
}
if (gdb_can_reverse()) {
if (gdbserver_state.accel_config.can_reverse) {
g_string_append(gdbserver_state.str_buf,
";ReverseStep+;ReverseContinue+");
}
-1
View File
@@ -154,7 +154,6 @@ 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); /* system emulation, stub for user */
int gdb_target_sigtrap(void); /* user */
void gdb_create_default_process(GDBState *s);
-5
View File
@@ -479,11 +479,6 @@ 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
*/
-6
View File
@@ -786,12 +786,6 @@ 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
View File
@@ -77,9 +77,11 @@ void accel_cpu_common_unrealize(CPUState *cpu);
* struct AccelGdbConfig - gdbstub configuration for an accelerator.
*
* @sstep_flags: Set SSTEP_* flags that accelerator supports for guest debug.
* @can_reverse: Whether reverse mode is supported.
*/
typedef struct AccelGdbConfig {
unsigned sstep_flags;
bool can_reverse;
} AccelGdbConfig;
#endif /* QEMU_ACCEL_H */