aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorFabien Chouteau <chouteau@adacore.com>2011-01-13 12:46:57 +0100
committerEdgar E. Iglesias <edgar.iglesias@petalogix.com>2011-01-16 20:56:01 +0100
commite2af15b2ad57d3c61b79c8aea0871e3a00264e96 (patch)
tree2d9f5ae9d609771d0e390d77ae0ebaa41165482c /gdbstub.c
parenta8fb7ff3fdd05ffb4cce1ab4d3ff7768a490f2f5 (diff)
downloadqemu-e2af15b2ad57d3c61b79c8aea0871e3a00264e96.zip
qemu-e2af15b2ad57d3c61b79c8aea0871e3a00264e96.tar.gz
qemu-e2af15b2ad57d3c61b79c8aea0871e3a00264e96.tar.bz2
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 <chouteau@adacore.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 0aa081b..d6556c9 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