]> git.proxmox.com Git - mirror_qemu.git/commitdiff
gdbstub: Do not kill target in system emulation mode
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 6 Mar 2012 17:32:35 +0000 (18:32 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 11 Mar 2012 11:23:19 +0000 (11:23 +0000)
Too many VM kittens were killed since 7d03f82f81. Another one just died
under my fat fingers.

When you quit a kgdb session, does the Linux kernel power off? Or when
you terminate gdb attached to a hardware debugger, does your board
vanish in space? No.

So let's stop terminating QEMU when the gdbstub receives a kill commando
in system emulation mode. Real termination can still be achieved via
"monitor quit". We keep the behavior for user mode emulation which is
arguably more like a gdbserver scenario.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
gdbstub.c

index 7d470b608eaccc2e9dea0a7eaa5e832e94ebbba3..ef95ac29ba2611fbc3b0830c4c010ca4b4c3f19c 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2062,9 +2062,11 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
             goto unknown_command;
         }
     case 'k':
+#ifdef CONFIG_USER_ONLY
         /* Kill the target */
         fprintf(stderr, "\nQEMU: Terminated via GDBstub\n");
         exit(0);
+#endif
     case 'D':
         /* Detach packet */
         gdb_breakpoint_remove_all();