OSDN Git Service

gdbstub: Set current CPU on interruptions
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 24 Jul 2015 16:52:31 +0000 (18:52 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 27 Jul 2015 19:46:16 +0000 (22:46 +0300)
gdb expects that the thread ID for c and g-class operations is set to
the CPU we provide when reporting VM stop conditions. If the stub is
still tuned to a different CPU, the wrong information is delivered to
the gdb frontend.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
gdbstub.c

index 92b2f81..ffe7e6e 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1285,6 +1285,7 @@ static void gdb_vm_state_change(void *opaque, int running, RunState state)
         ret = GDB_SIGNAL_UNKNOWN;
         break;
     }
+    gdb_set_stop_cpu(cpu);
     snprintf(buf, sizeof(buf), "T%02xthread:%02x;", ret, cpu_index(cpu));
 
 send_packet: