From patchwork Thu Jan 13 11:46:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Chouteau X-Patchwork-Id: 78728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 12AACB6F1E for ; Thu, 13 Jan 2011 22:51:25 +1100 (EST) Received: from localhost ([127.0.0.1]:50685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdLi6-0000hA-KN for incoming@patchwork.ozlabs.org; Thu, 13 Jan 2011 06:51:22 -0500 Received: from [140.186.70.92] (port=56659 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdLgx-0000Hk-Cu for qemu-devel@nongnu.org; Thu, 13 Jan 2011 06:50:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdLgw-0005jk-4P for qemu-devel@nongnu.org; Thu, 13 Jan 2011 06:50:11 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:45796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdLgv-0005je-WC for qemu-devel@nongnu.org; Thu, 13 Jan 2011 06:50:10 -0500 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 4898FCB02EA; Thu, 13 Jan 2011 12:50:09 +0100 (CET) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RshQI6czDuEB; Thu, 13 Jan 2011 12:50:09 +0100 (CET) Received: from PomPomGalli.act-europe.fr (pompomgalli.act-europe.fr [10.10.1.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 2BB62CB01BA; Thu, 13 Jan 2011 12:50:09 +0100 (CET) From: Fabien Chouteau To: qemu-devel@nongnu.org Date: Thu, 13 Jan 2011 12:46:57 +0100 Message-Id: <92a1896f5af064a8ed5477c52c2556f2bb0f6948.1294918897.git.chouteau@adacore.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Fabien Chouteau Subject: [Qemu-devel] [PATCH v2] gdbstub: Close connection in gdb_exit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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