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é
2026-06-26 12:41:49 +02:00
parent d1286e2933
commit 2aaa8ee7de
6 changed files with 7 additions and 14 deletions

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+");
}

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);

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
*/

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
*/