From patchwork Fri Aug 5 18:57:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 14358 Received: (qmail 4492 invoked by alias); 5 Aug 2016 18:57:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4481 invoked by uid 89); 5 Aug 2016 18:57:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Eliminate, 8888, news X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 05 Aug 2016 18:57:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06DB461E5B for ; Fri, 5 Aug 2016 18:57:06 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u75Iv4Cj021798 for ; Fri, 5 Aug 2016 14:57:05 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed master+7.12] Fix PR remote/20398: File-IO write always outputs "Quit" Date: Fri, 5 Aug 2016 19:57:04 +0100 Message-Id: <1470423424-9326-1-git-send-email-palves@redhat.com> Commit bb7c96deb1a1 ("gdb/remote-fileio.c: Eliminate custom SIGINT signal handler") regressed the File-IO support. Failed output: (gdb) target remote :8888 Remote debugging using :8888 0x00008098 in _start () (gdb) c Continuing. Quit Quit Quit Quit Quit Quit Quit Quit Quit Quit Quit [Inferior 1 (Remote target) exited normally] Expected output: (gdb) target remote :8888 Remote debugging using :8888 0x00008098 in _start () (gdb) c Continuing. i: 0 i: 1 i: 2 i: 3 i: 4 i: 5 i: 6 i: 7 i: 8 i: 9 [Inferior 1 (Remote target) exited normally] The problem that the new File-IO quit handler forgets to check the quit flag before calling throwing a quit. gdb/ChangeLog: 2016-08-05 Pedro Alves PR remote/20398 * remote-fileio.c (remote_fileio_quit_handler): Check the quit flag before calling quit. --- gdb/ChangeLog | 6 ++++++ gdb/remote-fileio.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 92f2cec..621235b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2016-08-05 Pedro Alves + PR remote/20398 + * remote-fileio.c (remote_fileio_quit_handler): Check the quit + flag before calling quit. + +2016-08-05 Pedro Alves + * NEWS: Mention that GDB and GDBserver build with a C++ compiler by default. diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 93121aa..e35bd5b 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -308,7 +308,8 @@ static quit_handler_ftype *remote_fileio_o_quit_handler; static void remote_fileio_quit_handler (void) { - quit (); + if (check_quit_flag ()) + quit (); } static void