From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56336 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdMuE-0001yT-LW for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:07:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdMuD-0005to-9K for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:07:58 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:45865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdMuD-0005qe-4h for qemu-devel@nongnu.org; Thu, 13 Jan 2011 08:07:57 -0500 Received: by wyg36 with SMTP id 36so1748040wyg.4 for ; Thu, 13 Jan 2011 05:07:56 -0800 (PST) Date: Thu, 13 Jan 2011 14:07:51 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH v2] gdbstub: Close connection in gdb_exit Message-ID: <20110113130751.GD7296@edde.se.axis.com> References: <92a1896f5af064a8ed5477c52c2556f2bb0f6948.1294918897.git.chouteau@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92a1896f5af064a8ed5477c52c2556f2bb0f6948.1294918897.git.chouteau@adacore.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-devel@nongnu.org On Thu, Jan 13, 2011 at 12:46:57PM +0100, Fabien Chouteau wrote: > 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. Hi, It seems a bit odd to explicitely close for system mode but to implicitely close (at exit) for user mode. But if no one complains, I'm OK with this version. Cheers > > Signed-off-by: Fabien Chouteau > --- > gdbstub.c | 6 ++++++ > 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 > -- > 1.7.1 > >