Commit e9c5654035 for qemu.org

commit e9c5654035834eb5b8f8ae53cb01376f6d8dd222
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Fri Jul 3 10:51:39 2026 +0200

    gdbstub: Move supported_sstep_flags in AccelGdbConfig structure

    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>
    Message-ID: <20260705215729.62196-14-philmd@oss.qualcomm.com>

diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index f54415a9db..06b712562c 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;
     }
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 60ddc14666..0444dee224 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 d3638c7bfd..052b4c5931 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:
  *