aboutsummaryrefslogtreecommitdiff
path: root/cpu.c
diff options
context:
space:
mode:
authorMads Ynddal <m.ynddal@samsung.com>2023-03-02 18:58:05 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 20:44:09 +0000
commit412ae12647d1086c713e13841fd25d10d5418c7f (patch)
treeb6db82a148295a5165f8208dc628589c06986797 /cpu.c
parent2d3d2517cc78763cc31da053a29786c53ccd90a2 (diff)
downloadqemu-412ae12647d1086c713e13841fd25d10d5418c7f.zip
qemu-412ae12647d1086c713e13841fd25d10d5418c7f.tar.gz
qemu-412ae12647d1086c713e13841fd25d10d5418c7f.tar.bz2
gdbstub: move update guest debug to accel ops
Continuing the refactor of a48e7d9e52 (gdbstub: move guest debug support check to ops) by removing hardcoded kvm_enabled() from generic cpu.c code, and replace it with a property of AccelOpsClass. Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230207131721.49233-1-mads@ynddal.dk> [AJB: add ifdef around update_guest_debug_ops, fix brace] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230302190846.2593720-27-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-30-richard.henderson@linaro.org>
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpu.c b/cpu.c
index e6abc6c..567b23a 100644
--- a/cpu.c
+++ b/cpu.c
@@ -31,8 +31,8 @@
#include "hw/core/sysemu-cpu-ops.h"
#include "exec/address-spaces.h"
#endif
+#include "sysemu/cpus.h"
#include "sysemu/tcg.h"
-#include "sysemu/kvm.h"
#include "exec/replay-core.h"
#include "exec/cpu-common.h"
#include "exec/exec-all.h"
@@ -326,9 +326,14 @@ void cpu_single_step(CPUState *cpu, int enabled)
{
if (cpu->singlestep_enabled != enabled) {
cpu->singlestep_enabled = enabled;
- if (kvm_enabled()) {
- kvm_update_guest_debug(cpu, 0);
+
+#if !defined(CONFIG_USER_ONLY)
+ const AccelOpsClass *ops = cpus_get_accel();
+ if (ops->update_guest_debug) {
+ ops->update_guest_debug(cpu);
}
+#endif
+
trace_breakpoint_singlestep(cpu->cpu_index, enabled);
}
}