From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28076 invoked by alias); 14 Aug 2012 19:49:34 -0000 Received: (qmail 28063 invoked by uid 22791); 14 Aug 2012 19:49:33 -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; Tue, 14 Aug 2012 19:49:12 +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 q7EJnCsc030833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Aug 2012 15:49:12 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7EJnAnB022646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 14 Aug 2012 15:49:11 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: [RFA 4/4 take 2] Improved linker-debugger interface References: <20120719110518.GE16185@redhat.com> <87394fhbv1.fsf@fleche.redhat.com> <20120731121149.GA4756@redhat.com> <20120731121253.GB4756@redhat.com> Date: Tue, 14 Aug 2012 19:49:00 -0000 In-Reply-To: <20120731121253.GB4756@redhat.com> (Gary Benson's message of "Tue, 31 Jul 2012 13:12:53 +0100") Message-ID: <87r4r9xnih.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (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-08/txt/msg00417.txt.bz2 >>>>> "Gary" == Gary Benson writes: Gary> 2012-07-30 Gary Benson Gary> * breakpoint.h (handle_solib_event): Moved function definition Gary> to solib.h, and added a new parameter. [...] Gary> +static void Gary> +free_probes (struct svr4_info *info) Gary> +{ Gary> + int i; Gary> + Gary> + for (i = 0; i < NUM_PROBES; i++) Gary> + VEC_free (probe_p, info->probes[i]); Gary> + Gary> + memset (info->probes, 0, sizeof (info->probes)); VEC_free sets the pointer to NULL, so this memset isn't needed. Gary> + val = evaluate_probe_argument (pi->probe, 0); Gary> + if (val == NULL) Gary> + goto error; I don't see evaluate_probe_argument in the tree. Maybe it was in another patch of yours? Anyway, can it really return NULL? I would expect it to throw an exception instead. If it does throw an exception, and since the error case needs some work, I think you will have to use cleanups here instead. Gary> +/* Helper function for namespace_table_flatten. */ Gary> + Gary> +static int Gary> +namespace_table_flatten_helper (void **slot, void *arg) Gary> +{ Gary> + struct namespace *ns = (struct namespace *) *slot; Gary> + struct so_list *src = ns->solist; Gary> + struct so_list **link = (struct so_list **) arg; Gary> + Gary> + while (*link) Gary> + link = &(*link)->next; I think this means we iterate over the entire linked list each time we visit some element in the hash table. It would not take much more effort to avoid this repeated iteration, by changing 'arg' to an object that also holds the link pointer at the tail of the list. Tom