From 85b6e24fa2a84ab980c5e26f8524b1f1b8649d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 30 Jun 2026 12:22:44 +0200 Subject: [PATCH] gdbstub: Reduce @type variable scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Message-ID: <20260705215729.62196-24-philmd@oss.qualcomm.com> --- gdbstub/system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdbstub/system.c b/gdbstub/system.c index bf7aa1ac23..9c4bd8ebcb 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -125,7 +125,6 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state) CPUState *cpu = gdbserver_state.c_cpu; g_autoptr(GString) buf = g_string_new(NULL); g_autoptr(GString) tid = g_string_new(NULL); - const char *type; int ret; if (running || gdbserver_state.state == RS_INACTIVE) { @@ -151,6 +150,8 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state) switch (state) { case RUN_STATE_DEBUG: if (cpu->watchpoint_hit) { + const char *type; + switch (cpu->watchpoint_hit->flags & BP_MEM_ACCESS) { case BP_MEM_READ: type = "r";