qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] gdbstub: shutdown guest when the target is killed


From: KONRAD Frederic
Subject: [Qemu-devel] [PATCH] gdbstub: shutdown guest when the target is killed
Date: Thu, 24 Jan 2019 13:47:49 +0100

Under MinGW when the target is killed no "W00" packet are received by GDB
because gdbstub takes the "exit(0)" path. So replace the "exit(0)" call by
a normal guest shutdown so the "W00" packet has a chance to be sent in
"gdb_cleanup".

Signed-off-by: KONRAD Frederic <address@hidden>
---
 gdbstub.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdbstub.c b/gdbstub.c
index bfc7afb..c91a909 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1389,7 +1389,12 @@ static int gdb_handle_packet(GDBState *s, const char 
*line_buf)
     case 'k':
         /* Kill the target */
         error_report("QEMU: Terminated via GDBstub");
+#ifdef CONFIG_USER_ONLY
         exit(0);
+#else
+        qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
+#endif
+        break;
     case 'D':
         /* Detach packet */
         pid = 1;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]