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>
*/
as->gdbstub.sstep_flags |= SSTEP_NOIRQ | SSTEP_NOTIMER;
}
+ if (replay_mode == REPLAY_MODE_PLAY) {
+ as->gdbstub.can_reverse = true;
+ }
page_init();
tb_htable_init();
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;
}
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+");
}
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);
return ms->smp.max_cpus;
}
-bool gdb_can_reverse(void)
-{
- return replay_mode == REPLAY_MODE_PLAY;
-}
-
/*
* Softmmu specific command helpers
*/
return max_cpus;
}
-/* replay not supported for user-mode */
-bool gdb_can_reverse(void)
-{
- return false;
-}
-
/*
* Break/Watch point helpers
*/
* 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 */