From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
KONRAD Frederic <frederic.konrad@adacore.com>,
Max Filippov <jcmvbkbc@gmail.com>,
Luc Michel <luc.michel@greensocs.com>
Subject: [Qemu-devel] [PATCH v2] gdbstub: allow killing QEMU via vKill command
Date: Wed, 30 Jan 2019 11:24:03 -0800 [thread overview]
Message-ID: <20190130192403.13754-1-jcmvbkbc@gmail.com> (raw)
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.michel@greensocs.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Changes v1->v2:
- terminate QEMU in the vKill packet handler regardless of whatever the
PID is or how many processes are attached [Luc Michel]
gdbstub.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index bfc7afb50968..96ffcd9d9d1d 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1383,6 +1383,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.11.0
next reply other threads:[~2019-01-30 19:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 19:24 Max Filippov [this message]
2019-01-31 16:15 ` [Qemu-devel] [PATCH v2] gdbstub: allow killing QEMU via vKill command Luc Michel
2019-02-01 10:44 ` KONRAD Frederic
2019-02-04 17:40 ` Peter Maydell
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=20190130192403.13754-1-jcmvbkbc@gmail.com \
--to=jcmvbkbc@gmail.com \
--cc=frederic.konrad@adacore.com \
--cc=luc.michel@greensocs.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).