gdbstub: Reduce @type variable scope
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260705215729.62196-24-philmd@oss.qualcomm.com>
Philippe Mathieu-Daudé committed
Jun 30, 2026 at 12:22 UTC
85b6e24fa2a84ab980c5e26f8524b1f1b8649d54
1 file changed
+2
-1
gdbstub/system.c
+2
-1
@@ -125,7 +125,6 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
125
CPUState *cpu = gdbserver_state.c_cpu;
126
g_autoptr(GString) buf = g_string_new(NULL);
127
g_autoptr(GString) tid = g_string_new(NULL);
128
- const char *type;
128
int ret;
129
130
if (running || gdbserver_state.state == RS_INACTIVE) {
@@ -151,6 +150,8 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
150
switch (state) {
151
case RUN_STATE_DEBUG:
152
if (cpu->watchpoint_hit) {
153
+ const char *type;
154
+
155
switch (cpu->watchpoint_hit->flags & BP_MEM_ACCESS) {
156
case BP_MEM_READ:
157
type = "r";