Skip to content

Commit

Permalink
gdbstub: Do not kill target in system emulation mode
Browse files Browse the repository at this point in the history
Too many VM kittens were killed since 7d03f82. 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>
  • Loading branch information
jan-kiszka authored and blueswirl committed Mar 11, 2012
1 parent 3f2cbf0 commit 00e94db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 00e94db

Please sign in to comment.