From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7135 invoked by alias); 6 May 2013 17:57:01 -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 7124 invoked by uid 89); 6 May 2013 17:57:00 -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; Mon, 06 May 2013 17:56:59 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r46HuwcD013425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 May 2013 13:56:58 -0400 Received: from barimba (ovpn-113-163.phx2.redhat.com [10.3.113.163]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r46Huuph009795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 6 May 2013 13:56:57 -0400 From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch 2/2] Assert leftover cleanups in TRY_CATCH References: <20130501165750.GA453@host2.jankratochvil.net> Date: Mon, 06 May 2013 17:57:00 -0000 In-Reply-To: <20130501165750.GA453@host2.jankratochvil.net> (Jan Kratochvil's message of "Wed, 1 May 2013 18:57:50 +0200") Message-ID: <87obcoyot3.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-05/txt/msg00129.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> 2013-05-01 Jan Kratochvil Jan> * cleanups.c (restore_my_cleanups): New gdb_assert for SENTINEL_CLEANUP. Thanks for doing this. I think it is a nice addition. We could do this for all cleanup-creating functions, at least when using GCC, if we didn't mind putting a declaration at the start of each such function: #if ... gcc .. #define CHECK_CLEANUP \ struct cleanup *__dummy ## __LINE__ \ __attribute__ ((cleanup (check_cleanup))) \ = get_checking_cleanup_pointer (); #endif This would call check_cleanup when the function exited normally, so we could verify that the cleanup chain was properly reset. I think it would be possible to automate adding this declaration in all needed spots. I'm curious what you think about it. Tom