]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 20 Jun 2025 08:59:21 +0000 (10:59 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 4 Jul 2025 10:08:44 +0000 (12:08 +0200)
In order to have AccelClass methods instrospect their state,
we need to pass AccelState by argument.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250703173248.44995-37-philmd@linaro.org>

accel/accel-common.c
accel/hvf/hvf-all.c
accel/kvm/kvm-all.c
accel/tcg/tcg-all.c
include/qemu/accel.h

index 4894b98d64aeb59c029fc37701a5496f51bd83ef..591ff4cbb654c6adb9232c16ee0c07e9b16fc6aa 100644 (file)
@@ -124,7 +124,7 @@ int accel_supported_gdbstub_sstep_flags(void)
     AccelState *accel = current_accel();
     AccelClass *acc = ACCEL_GET_CLASS(accel);
     if (acc->gdbstub_supported_sstep_flags) {
-        return acc->gdbstub_supported_sstep_flags();
+        return acc->gdbstub_supported_sstep_flags(accel);
     }
     return 0;
 }
index 68f1425fae2681806abb99cca4479b561482e27c..b6075c036e2693f5bdc48e3e1e2dcb55ef803950 100644 (file)
@@ -281,7 +281,7 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
     return hvf_arch_init();
 }
 
-static int hvf_gdbstub_sstep_flags(void)
+static int hvf_gdbstub_sstep_flags(AccelState *as)
 {
     return SSTEP_ENABLE | SSTEP_NOIRQ;
 }
index 6f6f9ef69bac31aa9adcc07e5006d0211544b9c8..45579f80fa558e3ff860e8b46670eda6d7f132f2 100644 (file)
@@ -3980,7 +3980,7 @@ static void kvm_accel_instance_init(Object *obj)
  * Returns: SSTEP_* flags that KVM supports for guest debug. The
  * support is probed during kvm_init()
  */
-static int kvm_gdbstub_sstep_flags(void)
+static int kvm_gdbstub_sstep_flags(AccelState *as)
 {
     return kvm_sstep_flags;
 }
index c674d5bcf78e08997537344ca7ecc0b140ff347a..5904582a68da7cbd79c21a5349a73a15e38f0cdf 100644 (file)
@@ -219,7 +219,7 @@ static void tcg_set_one_insn_per_tb(Object *obj, bool value, Error **errp)
     qatomic_set(&one_insn_per_tb, value);
 }
 
-static int tcg_gdbstub_supported_sstep_flags(void)
+static int tcg_gdbstub_supported_sstep_flags(AccelState *as)
 {
     /*
      * In replay mode all events will come from the log and can't be
index a6a95ff0bcd801d7c63dbe64bb183d0fa2fb1def..1c097ac4dfb6928248037aaa8607a074797ff7cf 100644 (file)
@@ -50,7 +50,7 @@ typedef struct AccelClass {
                        hwaddr start_addr, hwaddr size);
 
     /* gdbstub related hooks */
-    int (*gdbstub_supported_sstep_flags)(void);
+    int (*gdbstub_supported_sstep_flags)(AccelState *as);
 
     bool *allowed;
     /*