]> git.proxmox.com Git - mirror_qemu.git/blobdiff - gdbstub.c
Merge tag 'qemu-slof-20211112' of github.com:aik/qemu into ppc-next
[mirror_qemu.git] / gdbstub.c
index 23baaef40e1bc49dd7e28a7545278635ac5b0cd1..141d7bc4ec151342a29f0d8baf212dc722f942fa 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -94,7 +94,7 @@ static inline int cpu_gdb_index(CPUState *cpu)
 {
 #if defined(CONFIG_USER_ONLY)
     TaskState *ts = (TaskState *) cpu->opaque;
-    return ts->ts_tid;
+    return ts ? ts->ts_tid : -1;
 #else
     return cpu->cpu_index + 1;
 #endif