From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4yFz-0000q7-Fm for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:33:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4yFb-00054K-8L for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:33:02 -0500 Received: from thoth.sbs.de ([192.35.17.2]:31548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4yFa-00053h-UU for qemu-devel@nongnu.org; Tue, 06 Mar 2012 12:32:39 -0500 Message-ID: <4F564A33.2080500@siemens.com> Date: Tue, 06 Mar 2012 18:32:35 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] gdbstub: Do not kill target in system emulation mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Anthony Liguori 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 --- gdbstub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 7d470b6..ef95ac2 100644 --- 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(); -- 1.7.3.4