From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31829 invoked by alias); 13 Apr 2012 17:02:04 -0000 Received: (qmail 31808 invoked by uid 22791); 13 Apr 2012 17:02:01 -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; Fri, 13 Apr 2012 17:01:46 +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 q3DH1jtq025141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Apr 2012 13:01: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 q3DH1hCT030449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 13 Apr 2012 13:01:44 -0400 From: Tom Tromey To: dje@google.com (Doug Evans) Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Fission patch 1/2 References: <20120413072548.EAA5F2461B3@ruffy.mtv.corp.google.com> Date: Fri, 13 Apr 2012 17:12:00 -0000 In-Reply-To: <20120413072548.EAA5F2461B3@ruffy.mtv.corp.google.com> (Doug Evans's message of "Fri, 13 Apr 2012 00:25:48 -0700 (PDT)") Message-ID: <87iph3y39k.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (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-04/txt/msg00371.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> +void Doug> +nullify_cleanup (struct cleanup *cleanup) Doug> +{ Doug> + struct cleanup *c; Doug> + Doug> + for (c = cleanup_chain; c->next != cleanup; c = c->next) Doug> + continue; Doug> + c->function = null_cleanup; Doug> +} I'd rather not have a general facility for this kind of thing in cleanups. I think it makes them even harder to reason about. Instead the problem can be solved locally by making the particular cleanup work conditionally. Doug> + FIXME: As an implementation detail between our callers and us, Doug> + USE_EXISTING_CU and KEEP are OK. But bubbling them up into their callers Doug> + isn't as clean as I'd like. Having more callers with good names Doug> + may be the way to go. */ I'd just remove it. Doug> + if (free_cu_cleanup != NULL) This sort of check is dangerous. A call to make_cleanup can return NULL in some situations -- not this particular situation, but if someone later modifies the code this can break. It is better to keep a separate flag. Doug> + The CU "per_cu" pointer is needed because offset alone is not enough to Doug> + uniquely identify the type. A file may have multiple .debug_types sections, Doug> + or the type may come from a DWO file. I wonder if this fixes PR 13627. Tom