From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12394 invoked by alias); 13 Apr 2012 17:23:21 -0000 Received: (qmail 12381 invoked by uid 22791); 13 Apr 2012 17:23:17 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Apr 2012 17:23:04 +0000 Received: by vcbfk14 with SMTP id fk14so2784563vcb.0 for ; Fri, 13 Apr 2012 10:23:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=n17soQE2I6kFpPm+roR+B8H6nGajR9K1mpgKfXwJ0jY=; b=VKMob6CKp1+/NAudRvJASdRmPU2dFRxhS9bqLlgM+WIIiovxfKdiyzGvg8F/JvibMo 2azEBWDahgzboiiYecYoQiLiNG3VOSLRaisAlNYDiqFgGygPMYTHVfaPQ7Sk3UJXvGbk tIeMFoTR6LTkpnJXbMXS3jEqafOgNMGDpGjNvFGf8qLpe4V9B+FBpKkKDtek6lQ+ms68 PQFc7Fk58JJnNfn/gTol2sSXxJxJC4vEBpe8HnXgZHNlimX8BssDSIgatVUZ1BWt559I 1vArXYZYWbOt3lqO6LwMcs+/PTmybJEEXkJeP8eniP/pTEE91xH8u36OIkKP9AgYsvhF Jq0A== Received: by 10.220.115.130 with SMTP id i2mr1120474vcq.72.1334337783397; Fri, 13 Apr 2012 10:23:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.115.130 with SMTP id i2mr1120469vcq.72.1334337783290; Fri, 13 Apr 2012 10:23:03 -0700 (PDT) Received: by 10.220.7.66 with HTTP; Fri, 13 Apr 2012 10:23:03 -0700 (PDT) In-Reply-To: <87iph3y39k.fsf@fleche.redhat.com> References: <20120413072548.EAA5F2461B3@ruffy.mtv.corp.google.com> <87iph3y39k.fsf@fleche.redhat.com> Date: Fri, 13 Apr 2012 17:30:00 -0000 Message-ID: Subject: Re: [RFC] Fission patch 1/2 From: Doug Evans To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQlNwtA5GZ1CKpB25UM0Tv1OWtOPGoXA7IZ6CKwpKHqDYHfVUP7O+U6bk9dz+trsd09xFgyMFK0RBL4nR7Tc69c5TSSFtaGfkeckLqUXg95xp0j+QVmqALI50TvAe2FV/XiVEIURI5RvgPL84aUkyYqfbsqBdQ== X-IsSubscribed: yes 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/msg00373.txt.bz2 On Fri, Apr 13, 2012 at 10:01 AM, Tom Tromey wrote: >>>>>> "Doug" =3D=3D Doug Evans writes: > > Doug> +void > Doug> +nullify_cleanup (struct cleanup *cleanup) > Doug> +{ > Doug> + =A0struct cleanup *c; > Doug> + > Doug> + =A0for (c =3D cleanup_chain; c->next !=3D cleanup; c =3D c->next) > Doug> + =A0 =A0continue; > Doug> + =A0c->function =3D null_cleanup; > Doug> +} > > I'd rather not have a general facility for this kind of thing in > cleanups. =A0I think it makes them even harder to reason about. =A0Instead > the problem can be solved locally by making the particular cleanup work > conditionally. I wonder if to some, but not complete, extent (*1) cleanups are more fragile than necessary because the API is more fragile than necessary. My intent was the opposite, but ok, such is life. [(*1) insert C++ vs C war :-)] > Doug> + =A0 FIXME: As an implementation detail between our callers and us, > Doug> + =A0 USE_EXISTING_CU and KEEP are OK. =A0But bubbling them up into= their callers > Doug> + =A0 isn't as clean as I'd like. =A0Having more callers with good = names > Doug> + =A0 may be the way to go. =A0*/ > > I'd just remove it. "works for me" > Doug> + =A0if (free_cu_cleanup !=3D NULL) > > This sort of check is dangerous. =A0A 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. That sounds pretty odd (and error prone). Are there *useful* situations in which make_cleanup can return NULL? Is it only the first one? It feels like it would be cleaner if that were never true, and thus the users needn't have a separate flag, and thus can be simpler (and thus the intuitive choice isn't the wrong thing to do). > Doug> + =A0 The CU "per_cu" pointer is needed because offset alone is not= enough to > Doug> + =A0 uniquely identify the type. =A0A file may have multiple .debu= g_types sections, > Doug> + =A0 or the type may come from a DWO file. > > I wonder if this fixes PR 13627. I didn't know the PR, but it did feel like a bug fix for that exact situati= on.