From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22070 invoked by alias); 2 Aug 2012 16:13:59 -0000 Received: (qmail 22061 invoked by uid 22791); 2 Aug 2012 16:13:58 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Aug 2012 16:13:45 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q72GDiF6000419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Aug 2012 12:13:45 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q72GDhj8006170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 2 Aug 2012 12:13:44 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: clear quit_flag in quit, not throw_exception Date: Thu, 02 Aug 2012 16:13:00 -0000 Message-ID: <87mx2dqnk8.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00076.txt.bz2 I noticed that throw_exception clears quit_flag and immediate_quit. This seems like it could cause gdb to miss C-c sometimes. In particular, if a SIGINT arrives and then, before QUIT is called, some code in gdb throws an unrelated exception, then the SIGINT will effectively be ignored. It seems to me that it is just as safe, and more correct, to clear these flags in the quit function. Tom * exceptions.c (throw_exception): Don't clear quit_flag or immediate_quit. * utils.c (quit): Clear quit_flag and immediate_quit. --- gdb/exceptions.c | 3 --- gdb/utils.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 7db9df9..84c21a2 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -221,9 +221,6 @@ exceptions_state_mc_action_iter_1 (void) void throw_exception (struct gdb_exception exception) { - quit_flag = 0; - immediate_quit = 0; - do_cleanups (all_cleanups ()); /* Jump to the containing catch_errors() call, communicating REASON diff --git a/gdb/utils.c b/gdb/utils.c index c69c3e0..6ba8c62 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1055,6 +1055,9 @@ print_sys_errmsg (const char *string, int errcode) void quit (void) { + quit_flag = 0; + immediate_quit = 0; + #ifdef __MSDOS__ /* No steenking SIGINT will ever be coming our way when the program is resumed. Don't lie. */ -- 1.7.7.6