From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25395 invoked by alias); 7 May 2013 14:20:22 -0000 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 Received: (qmail 25384 invoked by uid 89); 7 May 2013 14:20:21 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 14:20:21 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r47EK2K2003209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 May 2013 10:20:02 -0400 Received: from host2.jankratochvil.net (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r47EJv6u013136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 7 May 2013 10:20:00 -0400 Date: Tue, 07 May 2013 14:20:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org Subject: [patch] [patch 2/2] Assert leftover cleanups in TRY_CATCH Message-ID: <20130507141957.GA11804@host2.jankratochvil.net> References: <20130501165750.GA453@host2.jankratochvil.net> <87obcoyot3.fsf@fleche.redhat.com> <20130507062305.GH5278@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130507062305.GH5278@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-05/txt/msg00221.txt.bz2 On Tue, 07 May 2013 08:23:05 +0200, Joel Brobecker wrote: > I agree. My only additional comment, after having hit this assertion, > is that it seems a bit harsh to be doing an abort in this case. > The problem showed up during a testsuite run, and so I would > investigate it regardless. But I can imagine the same issue > occurring during a real debugging session trying to chase a bug - > I'd be pretty upset to see my session ended like that. > > Should we consider changing it into an internal_warning? I forgot the direction GDB should not crash on recoverable issues. Jan gdb/ 2013-05-07 Jan Kratochvil * cleanups.c (restore_my_cleanups): Replace gdb_assert by internal_warning. diff --git a/gdb/cleanups.c b/gdb/cleanups.c index 02db9f5..1b5d973 100644 --- a/gdb/cleanups.c +++ b/gdb/cleanups.c @@ -261,7 +261,10 @@ save_final_cleanups (void) static void restore_my_cleanups (struct cleanup **pmy_chain, struct cleanup *chain) { - gdb_assert (*pmy_chain == SENTINEL_CLEANUP); + if (*pmy_chain != SENTINEL_CLEANUP) + internal_warning (__FILE__, __LINE__, + _("restore_my_cleanups has found a stale cleanup")); + *pmy_chain = chain; }