From 270dbee10cd31b86f0a3a8a2691026bdb0b9a071 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 23 Jan 2025 14:09:19 +0100 Subject: gdbstub: Check for TCG before calling tb_flush() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the tcg_enabled() check so the compiler can elide the call when TCG isn't available, allowing to remove the tb_flush() stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-4-philmd@linaro.org> --- gdbstub/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdbstub/system.c') diff --git a/gdbstub/system.c b/gdbstub/system.c index 8ce79fa88c..7f047a285c 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -22,6 +22,7 @@ #include "system/cpus.h" #include "system/runstate.h" #include "system/replay.h" +#include "system/tcg.h" #include "hw/core/cpu.h" #include "hw/cpu/cluster.h" #include "hw/boards.h" @@ -171,7 +172,9 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state) } else { trace_gdbstub_hit_break(); } - tb_flush(cpu); + if (tcg_enabled()) { + tb_flush(cpu); + } ret = GDB_SIGNAL_TRAP; break; case RUN_STATE_PAUSED: -- cgit 1.4.1