qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] gdbstub: send a terminaison packet instead of c


From: KONRAD Frederic
Subject: Re: [Qemu-devel] [PATCH] gdbstub: send a terminaison packet instead of crashing gdb
Date: Fri, 16 Mar 2018 19:45:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/16/2018 05:34 PM, Peter Maydell wrote:
On 16 March 2018 at 16:23, KONRAD Frederic <address@hidden> wrote:
Since the commit:
commit 4486e89c219c0d1b9bd8dfa0b1dd5b0d51ff2268
Author: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
---
  gdbstub.c              | 7 +++++++
  include/exec/gdbstub.h | 2 ++
  vl.c                   | 2 ++
  3 files changed, 11 insertions(+)

We didn't send an exiting packet before commit 4486e89c219c0,
so do you know why this worked before then? (Telling gdb we're
exiting seems like the right thing, though.)


Hmmm good question, I didn't had time to investigate in detail

Before 4486e89c219c0:

(gdb) tar rem :1234
Remote debugging using :1234
0x40000000 in trap_table ()
(gdb) c
Continuing.
Remote connection closed

After 4486e89c219c0:

(gdb) tar rem :1234
Remote debugging using :1234
0x40000000 in trap_table ()
(gdb) c
Continuing.
putpkt: write failed: Connection reset by peer.

With the patch:

(gdb) tar rem :1234
Remote debugging using :1234
0x40000000 in trap_table ()
(gdb) c
Continuing.
[Inferior 1 (Thread 0) exited normally]

We use to have this patch in our repository to avoid the remote
connection closed above.

Thanks,
Fred

thanks
-- PMM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]