From: Sandra Loosemore <sandra@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH] gdbstub: Send a reply to the vKill packet.
Date: Tue, 12 Feb 2019 14:47:13 -0700 [thread overview]
Message-ID: <1550008033-26540-1-git-send-email-sandra@codesourcery.com> (raw)
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>
---
gdbstub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdbstub.c b/gdbstub.c
index 70cf330..eb129f6 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1363,6 +1363,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 {
--
2.8.1
next reply other threads:[~2019-02-12 21:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 21:47 Sandra Loosemore [this message]
2019-02-14 17:48 ` [Qemu-devel] [PATCH] gdbstub: Send a reply to the vKill packet Peter Maydell
2019-02-14 18:27 ` Sandra Loosemore
2019-08-27 22:20 ` Aleksandar Markovic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550008033-26540-1-git-send-email-sandra@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).