From: KONRAD Frederic <frederic.konrad@adacore.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>
Cc: famz@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] gdbstub: send a terminaison packet instead of crashing gdb
Date: Mon, 19 Mar 2018 10:52:28 +0100 [thread overview]
Message-ID: <4f4b939b-b4a9-eaee-a8f5-d480d02a0b64@adacore.com> (raw)
In-Reply-To: <1b9b4a96-c415-f96d-132a-82883d14d66c@amsat.org>
Hi Philippe,
Thanks for the review!
BTW I forgot the for 2.12 tag can this be included in 2.12 or is
it too late?
Thanks,
Fred
On 03/19/2018 12:30 AM, Philippe Mathieu-Daudé wrote:
> On 03/16/2018 05:23 PM, KONRAD Frederic wrote:
>> Since the commit:
>> commit 4486e89c219c0d1b9bd8dfa0b1dd5b0d51ff2268
>> Author: Stefan Hajnoczi <stefanha@redhat.com>
>> Date: Wed Mar 7 14:42:05 2018 +0000
>>
>> vl: introduce vm_shutdown()
>>
>> GDB crash when qemu exits (at least on sparc-softmmu):
>> Remote communication error. Target disconnected.: Connection reset by peer.
>> Quitting: putpkt: write failed: Broken pipe.
>>
>> So send a packet to kill GDB before we exit QEMU:
>> [Inferior 1 (Thread 0) exited normally]
>>
>> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>> ---
>> gdbstub.c | 7 +++++++
>> include/exec/gdbstub.h | 2 ++
>> vl.c | 2 ++
>> 3 files changed, 11 insertions(+)
>>
>> diff --git a/gdbstub.c b/gdbstub.c
>> index f1d5148..a76b2fa 100644
>> --- a/gdbstub.c
>> +++ b/gdbstub.c
>> @@ -2052,6 +2052,13 @@ int gdbserver_start(const char *device)
>> return 0;
>> }
>>
>> +void gdbserver_cleanup(void)
>> +{
>> + if (gdbserver_state) {
>> + put_packet(gdbserver_state, "W00");
>> + }
>> +}
>> +
>> static void register_types(void)
>> {
>> type_register_static(&char_gdb_type_info);
>> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
>> index 9aa7756..2e8a4b8 100644
>> --- a/include/exec/gdbstub.h
>> +++ b/include/exec/gdbstub.h
>> @@ -103,6 +103,8 @@ int gdbserver_start(int);
>> int gdbserver_start(const char *port);
>> #endif
>>
>> +void gdbserver_cleanup(void);
>> +
>> /**
>> * gdb_has_xml:
>> * This is an ugly hack to cope with both new and old gdb.
>> diff --git a/vl.c b/vl.c
>> index 3ef04ce..0427b15 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -4723,6 +4723,8 @@ int main(int argc, char **argv, char **envp)
>>
>> main_loop();
>>
>> + gdbserver_cleanup();
>> +
>> /* No more vcpu or device emulation activity beyond this point */
>> vm_shutdown();
>>
>>
next prev parent reply other threads:[~2018-03-19 9:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-16 16:23 [Qemu-devel] [PATCH] gdbstub: send a terminaison packet instead of crashing gdb KONRAD Frederic
2018-03-16 16:34 ` Peter Maydell
2018-03-16 18:45 ` KONRAD Frederic
2018-03-19 17:09 ` Stefan Hajnoczi
2018-03-18 23:30 ` Philippe Mathieu-Daudé
2018-03-19 9:52 ` KONRAD Frederic [this message]
2018-03-19 17:46 ` [Qemu-devel] [PATCH for-2.12] " Eric Blake
2018-03-19 17:43 ` [Qemu-devel] [PATCH] " Eric Blake
2018-03-20 9:01 ` KONRAD Frederic
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=4f4b939b-b4a9-eaee-a8f5-d480d02a0b64@adacore.com \
--to=frederic.konrad@adacore.com \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).