From patchwork Tue Jan 4 10:27:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Close Gdb stub connection in gdb_exit Date: Tue, 04 Jan 2011 00:27:49 -0000 From: Fabien Chouteau X-Patchwork-Id: 77446 Message-Id: To: qemu-devel@nongnu.org Cc: Fabien Chouteau On Windows, this is required to flush the remaining data in the IO stream, otherwise Gdb do not receive the last packet. Signed-off-by: Fabien Chouteau --- gdbstub.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 0aa081b..dac3ce6 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2391,6 +2391,10 @@ void gdb_exit(CPUState *env, int code) snprintf(buf, sizeof(buf), "W%02x", (uint8_t)code); put_packet(s, buf); + + if (s->chr) { + qemu_chr_close(s->chr); + } } #ifdef CONFIG_USER_ONLY