From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Xiaoyao Li" <xiaoyao.li@intel.com>,
"Chao Liu" <chao.liu.zevorn@gmail.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
qemu-ppc@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: [PATCH 13/33] accel: Have get_gdbstub_config() return @can_reverse value
Date: Wed, 1 Jul 2026 00:00:40 +0200 [thread overview]
Message-ID: <20260630220100.1289-14-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260630220100.1289-1-philmd@oss.qualcomm.com>
Have accelerators set @can_reverse in their get_gdbstub_config()
handler. Remove gdb_can_reverse() as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
gdbstub/internals.h | 1 -
include/accel/accel-ops.h | 3 ++-
include/qemu/accel.h | 5 +++--
accel/accel-common.c | 5 +++--
accel/hvf/hvf-all.c | 4 +++-
accel/kvm/kvm-all.c | 4 +++-
accel/tcg/tcg-all.c | 4 +++-
gdbstub/gdbstub.c | 4 ++--
gdbstub/system.c | 5 -----
gdbstub/user.c | 6 ------
10 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 9a1b8d9dd8a..dbd6d11eb8c 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -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);
diff --git a/include/accel/accel-ops.h b/include/accel/accel-ops.h
index 1bc359ff3e5..07241f799a8 100644
--- a/include/accel/accel-ops.h
+++ b/include/accel/accel-ops.h
@@ -37,7 +37,8 @@ struct AccelClass {
hwaddr start_addr, hwaddr size);
/* gdbstub related hooks */
- void (*get_gdbstub_config)(AccelState *as, int *supported_sstep_flags);
+ void (*get_gdbstub_config)(AccelState *as, int *supported_sstep_flags,
+ bool *can_reverse);
bool *allowed;
/*
diff --git a/include/qemu/accel.h b/include/qemu/accel.h
index 92f9c538f31..e740939908a 100644
--- a/include/qemu/accel.h
+++ b/include/qemu/accel.h
@@ -76,10 +76,11 @@ void accel_cpu_common_unrealize(CPUState *cpu);
/**
* accel_get_gdbstub_config:
* @supported_sstep_flags: pointer to store the single step modes in
+ * @can_reverse: pointer to store whether reverse mode is supported
*
- * Set the supported single step modes for the configured
+ * Set the supported single step and reverse modes for the configured
* accelerator.
*/
-void accel_get_gdbstub_config(int *supported_sstep_flags);
+void accel_get_gdbstub_config(int *supported_sstep_flags, bool *can_reverse);
#endif /* QEMU_ACCEL_H */
diff --git a/accel/accel-common.c b/accel/accel-common.c
index 526ab2a0cfb..41f98937426 100644
--- a/accel/accel-common.c
+++ b/accel/accel-common.c
@@ -113,14 +113,15 @@ void accel_cpu_common_unrealize(CPUState *cpu)
}
}
-void accel_get_gdbstub_config(int *supported_sstep_flags)
+void accel_get_gdbstub_config(int *supported_sstep_flags, bool *can_reverse)
{
AccelState *accel = current_accel();
AccelClass *acc = ACCEL_GET_CLASS(accel);
if (acc->get_gdbstub_config) {
- acc->get_gdbstub_config(accel, supported_sstep_flags);
+ acc->get_gdbstub_config(accel, supported_sstep_flags, can_reverse);
} else {
*supported_sstep_flags = 0;
+ *can_reverse = false;
}
}
diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
index 284ce8ebff1..49014de26d1 100644
--- a/accel/hvf/hvf-all.c
+++ b/accel/hvf/hvf-all.c
@@ -228,9 +228,11 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
return hvf_arch_init();
}
-static void hvf_gdbstub_config(AccelState *as, int *supported_sstep_flags)
+static void hvf_gdbstub_config(AccelState *as, int *supported_sstep_flags,
+ bool *can_reverse)
{
*supported_sstep_flags = SSTEP_ENABLE | SSTEP_NOIRQ;
+ *can_reverse = false;
}
static void hvf_set_kernel_irqchip(Object *obj, Visitor *v,
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 72d6eb464db..0019a092d69 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -4286,11 +4286,13 @@ static void kvm_accel_instance_init(Object *obj)
* Set SSTEP_* flags that KVM supports for guest debug. The
* support is probed during kvm_init()
*/
-static void kvm_gdbstub_config(AccelState *as, int *supported_sstep_flags)
+static void kvm_gdbstub_config(AccelState *as, int *supported_sstep_flags,
+ bool *can_reverse)
{
KVMState *s = KVM_STATE(as);
*supported_sstep_flags = s->gdbstub_sstep_flags;
+ *can_reverse = false;
}
static void kvm_accel_class_init(ObjectClass *oc, const void *data)
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 89f7e025021..2d2aab80d17 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -242,7 +242,8 @@ static void tcg_set_one_insn_per_tb(Object *obj, bool value, Error **errp)
qatomic_set(&one_insn_per_tb, value);
}
-static void tcg_gdbstub_config(AccelState *as, int *supported_sstep_flags)
+static void tcg_gdbstub_config(AccelState *as, int *supported_sstep_flags,
+ bool *can_reverse)
{
/*
* In replay mode all events will come from the log and can't be
@@ -255,6 +256,7 @@ static void tcg_gdbstub_config(AccelState *as, int *supported_sstep_flags)
} else {
*supported_sstep_flags = SSTEP_ENABLE | SSTEP_NOIRQ | SSTEP_NOTIMER;
}
+ *can_reverse = replay_mode == REPLAY_MODE_PLAY;
}
static void tcg_accel_class_init(ObjectClass *oc, const void *data)
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 0037704d522..0a691c95880 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -72,10 +72,10 @@ void gdb_init_gdbserver_state(void)
* By default try to use no IRQs and no timers while single
* stepping so as to make single stepping like a typical ICE HW step.
*/
- accel_get_gdbstub_config(&gdbserver_state.supported_sstep_flags);
+ accel_get_gdbstub_config(&gdbserver_state.supported_sstep_flags,
+ &gdbserver_state.can_reverse);
gdbserver_state.sstep_flags = SSTEP_ENABLE | SSTEP_NOIRQ | SSTEP_NOTIMER;
gdbserver_state.sstep_flags &= gdbserver_state.supported_sstep_flags;
- gdbserver_state.can_reverse = gdb_can_reverse();
}
/* writes 2*len+1 bytes in buf */
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 2063b63b2f8..1421645c6e5 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -477,11 +477,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
*/
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 97eb13e796a..2cc851691f7 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -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.53.0
next prev parent reply other threads:[~2026-06-30 22:04 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 22:00 [PATCH 00/33] accel: Unassorted cleanups around debugging Philippe Mathieu-Daudé
2026-06-30 22:00 ` [PATCH 01/33] cpu: Constify CPUState::cc (cached CPUClass pointer) Philippe Mathieu-Daudé
2026-07-02 13:16 ` Daniel Henrique Barboza
2026-07-02 16:08 ` Richard Henderson
2026-07-03 0:41 ` Chao Liu
2026-06-30 22:00 ` [PATCH 02/33] target/i386: Remove duplicate tlb_flush() call in cpu_post_load() Philippe Mathieu-Daudé
2026-07-02 16:27 ` Richard Henderson
2026-07-03 0:42 ` Chao Liu
2026-06-30 22:00 ` [PATCH 03/33] accel/tcg: Restrict tlb_protect/unprotect_code() to TCG Philippe Mathieu-Daudé
2026-07-02 13:17 ` Daniel Henrique Barboza
2026-07-02 16:29 ` Richard Henderson
2026-07-03 3:13 ` Chao Liu
2026-06-30 22:00 ` [PATCH 04/33] accel/hvf: Remove left-over comment Philippe Mathieu-Daudé
2026-07-02 13:36 ` Daniel Henrique Barboza
2026-07-02 16:29 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 05/33] accel/mshv: Replace @dirty field by generic CPUState::vcpu_dirty field Philippe Mathieu-Daudé
2026-07-02 13:00 ` Philippe Mathieu-Daudé
2026-07-02 13:41 ` Magnus Kulke
2026-07-02 16:56 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 06/33] gdbstub: Add trace event for STEP packet handler Philippe Mathieu-Daudé
2026-07-02 13:18 ` Daniel Henrique Barboza
2026-07-02 13:25 ` Alex Bennée
2026-06-30 22:00 ` [PATCH 07/33] gdbstub: Only return E22 when reverse GDB is not supported Philippe Mathieu-Daudé
2026-07-02 13:18 ` Daniel Henrique Barboza
2026-07-02 13:26 ` Alex Bennée
2026-06-30 22:00 ` [PATCH 08/33] accel/kvm: Always define AccelOpsClass::supports_guest_debug Philippe Mathieu-Daudé
2026-07-02 13:19 ` Daniel Henrique Barboza
2026-07-02 17:16 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 09/33] accel/kvm: Simplify kvm_init() w.r.t. TARGET_KVM_HAVE_GUEST_DEBUG Philippe Mathieu-Daudé
2026-07-02 17:18 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 10/33] accel: Change gdbstub_supported_sstep_flags() -> get_gdbstub_config() Philippe Mathieu-Daudé
2026-07-02 13:50 ` Alex Bennée
2026-07-02 13:58 ` Philippe Mathieu-Daudé
2026-06-30 22:00 ` [PATCH 11/33] gdbstub: Store @can_reverse in GDBState Philippe Mathieu-Daudé
2026-07-02 13:20 ` Daniel Henrique Barboza
2026-06-30 22:00 ` [PATCH 12/33] gdbstub: Make default replay_mode value explicit in stubs Philippe Mathieu-Daudé
2026-07-02 17:21 ` Richard Henderson
2026-06-30 22:00 ` Philippe Mathieu-Daudé [this message]
2026-06-30 22:00 ` [PATCH 14/33] accel: Move supports_guest_debug() declaration to AccelClass Philippe Mathieu-Daudé
2026-07-02 17:29 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 15/33] accel/kvm: Hold have_guest_supported in KVMState Philippe Mathieu-Daudé
2026-07-02 13:22 ` Daniel Henrique Barboza
2026-07-02 17:37 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 16/33] accel/kvm: Hold gdbstub_sstep_flags " Philippe Mathieu-Daudé
2026-07-02 13:22 ` Daniel Henrique Barboza
2026-07-02 17:42 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 17/33] cpu: Move BREAKPOINT definitions to 'exec/breakpoint.h' Philippe Mathieu-Daudé
2026-07-02 13:24 ` Daniel Henrique Barboza
2026-07-02 17:43 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 18/33] cpu: Define BreakpointFlags type Philippe Mathieu-Daudé
2026-07-02 13:26 ` Daniel Henrique Barboza
2026-07-02 13:57 ` Philippe Mathieu-Daudé
2026-07-02 17:44 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 19/33] accel: Remove unnecessary 'inline' qualifier in remove_all_breakpoints Philippe Mathieu-Daudé
2026-07-02 13:27 ` Daniel Henrique Barboza
2026-07-02 17:45 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 20/33] gdbstub/user: Directly call gdb_breakpoint_remove_all() in user mode Philippe Mathieu-Daudé
2026-07-02 13:27 ` Daniel Henrique Barboza
2026-07-02 17:46 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 21/33] gdbstub: Reduce @type variable scope Philippe Mathieu-Daudé
2026-07-02 13:27 ` Daniel Henrique Barboza
2026-07-02 17:47 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 22/33] gdbstub: Introduce GdbBreakpointType enumerator Philippe Mathieu-Daudé
2026-07-02 13:29 ` Daniel Henrique Barboza
2026-07-02 13:53 ` Philippe Mathieu-Daudé
2026-07-02 17:50 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 23/33] accel: Use GdbBreakpointType enum Philippe Mathieu-Daudé
2026-07-02 13:31 ` Daniel Henrique Barboza
2026-07-02 17:52 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 24/33] target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint() Philippe Mathieu-Daudé
2026-07-02 17:53 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 25/33] target/arm: Factor arm_check_watchpoint_hit() out Philippe Mathieu-Daudé
2026-07-02 18:02 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 26/33] target/xtensa: Move watchpoints handling to check_hw_watchpoints() Philippe Mathieu-Daudé
2026-07-02 18:06 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 27/33] target/ppc: Ensure TCG is used in ppc_update_daw() Philippe Mathieu-Daudé
2026-07-02 13:34 ` Daniel Henrique Barboza
2026-06-30 22:00 ` [PATCH 28/33] accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlers Philippe Mathieu-Daudé
2026-07-02 13:34 ` Daniel Henrique Barboza
2026-07-02 18:04 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 29/33] cpu: Move CPUWatchpoint definition to 'exec/watchpoint.h' Philippe Mathieu-Daudé
2026-07-02 18:06 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 30/33] cpu: Better name cpu_single_step() trace event Philippe Mathieu-Daudé
2026-07-02 13:35 ` Daniel Henrique Barboza
2026-06-30 22:00 ` [PATCH 31/33] cpu: Introduce cpu_single_stepping() helper Philippe Mathieu-Daudé
2026-07-02 18:11 ` Richard Henderson
2026-06-30 22:00 ` [PATCH 32/33] cpu: Rename CPUState @singlestep_enabled -> @singlestep_flags Philippe Mathieu-Daudé
2026-07-02 18:11 ` Richard Henderson
2026-07-03 1:27 ` Xiaoyao Li
2026-07-03 1:50 ` Philippe Mathieu-Daudé
2026-06-30 22:01 ` [PATCH 33/33] cpu: Only check SSTEP_ENABLE flag in cpu_single_stepping() Philippe Mathieu-Daudé
2026-07-02 13:36 ` Daniel Henrique Barboza
2026-07-02 18:11 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260630220100.1289-14-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=alex.bennee@linaro.org \
--cc=chao.liu.zevorn@gmail.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=xiaoyao.li@intel.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.