From: Fabien Chouteau Date: Thu, 13 Jan 2011 11:46:57 +0000 (+0100) Subject: gdbstub: Close connection in gdb_exit X-Git-Tag: v0.14.0-rc0~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2af15b2ad57d3c61b79c8aea0871e3a00264e96;p=thirdparty%2Fqemu.git gdbstub: Close connection in gdb_exit On Windows, this is required to flush the remaining data in the IO stream, otherwise Gdb do not receive the last packet. Version 2: Fix linux-user build error. Signed-off-by: Fabien Chouteau Signed-off-by: Edgar E. Iglesias --- diff --git a/gdbstub.c b/gdbstub.c index 0aa081b13b8..d6556c9a2fe 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2391,6 +2391,12 @@ void gdb_exit(CPUState *env, int code) snprintf(buf, sizeof(buf), "W%02x", (uint8_t)code); put_packet(s, buf); + +#ifndef CONFIG_USER_ONLY + if (s->chr) { + qemu_chr_close(s->chr); + } +#endif } #ifdef CONFIG_USER_ONLY