From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7528 invoked by alias); 1 May 2013 19:44:36 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 7517 invoked by uid 89); 1 May 2013 19:44:36 -0000 X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,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; Wed, 01 May 2013 19:44:35 +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 r41JiYOp010439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 May 2013 15:44:34 -0400 Received: from host2.jankratochvil.net (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r41JiU0f029249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 1 May 2013 15:44:33 -0400 Date: Wed, 01 May 2013 19:44:00 -0000 From: Jan Kratochvil To: Phil Muldoon Cc: gdb@sourceware.org Subject: Re: Cleanups and Exception handlers Message-ID: <20130501194430.GA16791@host2.jankratochvil.net> References: <5180EE37.3020507@redhat.com> <20130501152116.GA7529@host2.jankratochvil.net> <518162F2.1000704@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <518162F2.1000704@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-05/txt/msg00009.txt.bz2 On Wed, 01 May 2013 20:46:10 +0200, Phil Muldoon wrote: > In the first example, where did the previously registered cleanup > outside of the TRY_CATCH go? Was it discarded (or leaked?) Right, leaked, forgotten in memory, a bug. The new patch will assert those: [patch 2/2] Assert leftover cleanups in TRY_CATCH http://sourceware.org/ml/gdb-patches/2013-05/msg00008.html > On 01/05/13 16:21, Jan Kratochvil wrote: > > In such case cleanups are executed already inside the TRY_CATCH block at the > > time the exception was thrown. throw_exception contains: > > do_cleanups (all_cleanups ()); > > Ok thanks, so in the case of cleanups entirely encapsulated in the > TRY_CATCH block there is no need to do anything in the later exception > handling block (the "if", after). Right. > > It seemed to me that there were too many TRY_CATCH blocks even in cases where > > nothing can throw an exception. > > This is because most (though I have no audited all of them) calls to > ui_out_* use *_filtered function calls (at least when the output is > directed to the CLI). These can be interrupted from GDB and Python > has to handle the resulting GDB generated keyboard interruption > exception. It's a massive pain in the neck. ;) Oops, OK. Jan