aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2019-02-14 18:45:49 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-02-14 18:45:49 +0000
commit497bc12b1b374ecd62903bf062229bd93f8924af (patch)
treeb5958170e4b2396730bc02ad6546fc6985e737c9
parentf37dbdb9fa14fbab1f78caed827589967149fd7e (diff)
downloadqemu-arm-497bc12b1b374ecd62903bf062229bd93f8924af.tar.gz
gdbstub: Send a reply to the vKill packet.pull-target-arm-20190214
Per the GDB remote protocol documentation https://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#index-vKill-packet the debug stub is expected to send a reply to the 'vKill' packet. At least some versions of GDB crash if the gdb stub simply exits without sending a reply. This patch fixes QEMU's gdb stub to conform to the expected behavior. Note that QEMU's existing handling of the legacy 'k' packet is correct: in that case GDB does not expect a reply, and QEMU does not send one. Signed-off-by: Sandra Loosemore <sandra@codesourcery.com> Message-id: 1550008033-26540-1-git-send-email-sandra@codesourcery.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--gdbstub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index ff19579452..bc774ae992 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1361,6 +1361,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
break;
} else if (strncmp(p, "Kill;", 5) == 0) {
/* Kill the target */
+ put_packet(s, "OK");
error_report("QEMU: Terminated via GDBstub");
exit(0);
} else {