From: Max Filippov <jcmvb...@gmail.com>

With multiprocess extensions gdb uses 'vKill' packet instead of 'k' to
kill the inferior. Handle 'vKill' the same way 'k' was handled in the
presence of single process.

Fixes: 7cf48f6752e5 ("gdbstub: add multiprocess support to
(f|s)ThreadInfo and ThreadExtraInfo")

Cc: Luc Michel <luc.mic...@greensocs.com>
Signed-off-by: Max Filippov <jcmvb...@gmail.com>
Reviewed-by: Luc Michel <luc.mic...@greensocs.com>
Reviewed-by: KONRAD Frederic <frederic.kon...@adacore.com>
Tested-by: KONRAD Frederic <frederic.kon...@adacore.com>
Message-id: 20190130192403.13754-1-jcmvb...@gmail.com
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
---
 gdbstub.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdbstub.c b/gdbstub.c
index 3129b5c2842..a4be63f6eb4 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1359,6 +1359,10 @@ static int gdb_handle_packet(GDBState *s, const char 
*line_buf)
 
             put_packet(s, buf);
             break;
+        } else if (strncmp(p, "Kill;", 5) == 0) {
+            /* Kill the target */
+            error_report("QEMU: Terminated via GDBstub");
+            exit(0);
         } else {
             goto unknown_command;
         }
-- 
2.20.1


Reply via email to