From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: Chao Liu <chao.liu.zevorn@gmail.com>,
alex.bennee@linaro.org, qemu-s390x@nongnu.org,
Magnus Kulke <magnuskulke@linux.microsoft.com>,
Zhao Liu <zhao1.liu@intel.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Richard Henderson <richard.henderson@linaro.org>,
Mohamed Mediouni <mohamed@unpredictable.fr>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [PATCH v3 13/32] gdbstub: Move supported_sstep_flags in AccelGdbConfig structure
Date: Sun, 5 Jul 2026 23:57:09 +0200 [thread overview]
Message-ID: <20260705215729.62196-14-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260705215729.62196-1-philmd@oss.qualcomm.com>
supported_sstep_flags are per-accelerators. Move them
to a new AccelGdbConfig structure, still in GDBState.
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
gdbstub/internals.h | 3 ++-
include/qemu/accel.h | 9 +++++++++
gdbstub/gdbstub.c | 10 +++++-----
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 60ddc146661..0444dee2246 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -9,6 +9,7 @@
#ifndef GDBSTUB_INTERNALS_H
#define GDBSTUB_INTERNALS_H
+#include "qemu/accel.h"
#include "exec/cpu-common.h"
/*
@@ -83,8 +84,8 @@ typedef struct GDBState {
int process_num;
GString *str_buf;
GByteArray *mem_buf;
+ AccelGdbConfig accel_config;
int sstep_flags;
- int supported_sstep_flags;
/*
* Whether we are allowed to send a stop reply packet at this moment.
* Must be set off after sending the stop reply itself.
diff --git a/include/qemu/accel.h b/include/qemu/accel.h
index d3638c7bfda..052b4c59313 100644
--- a/include/qemu/accel.h
+++ b/include/qemu/accel.h
@@ -73,6 +73,15 @@ bool accel_cpu_common_realize(CPUState *cpu, Error **errp);
*/
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.
+ */
+typedef struct AccelGdbConfig {
+ unsigned sstep_flags;
+} AccelGdbConfig;
+
/**
* accel_supported_gdbstub_sstep_flags:
*
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index f54415a9db7..06b712562c5 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -72,9 +72,9 @@ 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.
*/
- gdbserver_state.supported_sstep_flags = accel_supported_gdbstub_sstep_flags();
+ gdbserver_state.accel_config.sstep_flags = accel_supported_gdbstub_sstep_flags();
gdbserver_state.sstep_flags = SSTEP_ENABLE | SSTEP_NOIRQ | SSTEP_NOTIMER;
- gdbserver_state.sstep_flags &= gdbserver_state.supported_sstep_flags;
+ gdbserver_state.sstep_flags &= gdbserver_state.accel_config.sstep_flags;
}
/* writes 2*len+1 bytes in buf */
@@ -1537,12 +1537,12 @@ static void handle_query_qemu_sstepbits(GArray *params, void *user_ctx)
{
g_string_printf(gdbserver_state.str_buf, "ENABLE=%x", SSTEP_ENABLE);
- if (gdbserver_state.supported_sstep_flags & SSTEP_NOIRQ) {
+ if (gdbserver_state.accel_config.sstep_flags & SSTEP_NOIRQ) {
g_string_append_printf(gdbserver_state.str_buf, ",NOIRQ=%x",
SSTEP_NOIRQ);
}
- if (gdbserver_state.supported_sstep_flags & SSTEP_NOTIMER) {
+ if (gdbserver_state.accel_config.sstep_flags & SSTEP_NOTIMER) {
g_string_append_printf(gdbserver_state.str_buf, ",NOTIMER=%x",
SSTEP_NOTIMER);
}
@@ -1560,7 +1560,7 @@ static void handle_set_qemu_sstep(GArray *params, void *user_ctx)
new_sstep_flags = gdb_get_cmd_param(params, 0)->val_ul;
- if (new_sstep_flags & ~gdbserver_state.supported_sstep_flags) {
+ if (new_sstep_flags & ~gdbserver_state.accel_config.sstep_flags) {
gdb_put_packet("E22");
return;
}
--
2.53.0
next prev parent reply other threads:[~2026-07-05 21:59 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-05 21:56 [PATCH v3 00/32] accel: Unassorted cleanups around debugging Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 01/32] cpu: Constify CPUState::cc (cached CPUClass pointer) Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 02/32] target/i386: Remove duplicate tlb_flush() call in cpu_post_load() Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 03/32] accel/tcg: Restrict tlb_protect/unprotect_code() to TCG Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 04/32] accel/hvf: Remove left-over comment Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 05/32] accel/mshv: Replace @dirty field by generic CPUState::vcpu_dirty field Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 06/32] gdbstub: Add trace event for STEP packet handler Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 07/32] gdbstub: Only return E22 when reverse GDB is not supported Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 08/32] accel/whpx: Implement missing AccelClass::gdbstub_supported_sstep_flags Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 09/32] accel/kvm: Always define AccelOpsClass::supports_guest_debug Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 10/32] accel/kvm: Simplify kvm_init() w.r.t. TARGET_KVM_HAVE_GUEST_DEBUG Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 11/32] accel/kvm: Hold have_guest_debug in KVMState Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 12/32] gdbstub: Reduce gdb_supports_guest_debug() scope Philippe Mathieu-Daudé
2026-07-05 21:57 ` Philippe Mathieu-Daudé [this message]
2026-07-05 21:57 ` [PATCH v3 14/32] accel: Have each implementation return their AccelGdbConfig Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 15/32] gdbstub: Make default replay_mode value explicit in stubs Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 16/32] accel: Hold @can_reverse information in AccelGdbConfig Philippe Mathieu-Daudé
2026-07-06 8:59 ` Manos Pitsidianakis
2026-07-05 21:57 ` [PATCH v3 17/32] accel: Remove AccelOpsClass::supports_guest_debug Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 18/32] cpu: Move cpu_breakpoint_test out of line Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 19/32] cpu: Move BREAKPOINT definitions to 'exec/breakpoint.h' Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 20/32] cpu: Define BreakpointFlags type Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 21/32] accel: Remove unnecessary 'inline' qualifier in remove_all_breakpoints Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 22/32] gdbstub/user: Directly call gdb_breakpoint_remove_all() in user mode Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 23/32] gdbstub: Reduce @type variable scope Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 24/32] gdbstub: Introduce GdbBreakpointType enumerator Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 25/32] accel: Use GdbBreakpointType enum Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 26/32] target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint() Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 27/32] target/ppc: Ensure TCG is used in ppc_update_daw() Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 28/32] accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlers Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 29/32] cpu: Better name cpu_single_step() trace event Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 30/32] cpu: Introduce cpu_single_stepping() helper Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 31/32] cpu: Rename CPUState @singlestep_enabled -> @singlestep_flags Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 32/32] cpu: Only check SSTEP_ENABLE flag in cpu_single_stepping() Philippe Mathieu-Daudé
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=20260705215729.62196-14-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=alex.bennee@linaro.org \
--cc=chao.liu.zevorn@gmail.com \
--cc=magnuskulke@linux.microsoft.com \
--cc=mohamed@unpredictable.fr \
--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.