From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23915 invoked by alias); 31 Jul 2012 12:12:12 -0000 Received: (qmail 23904 invoked by uid 22791); 31 Jul 2012 12:12:09 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO gbenson.demon.co.uk) (80.177.220.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Jul 2012 12:11:52 +0000 Date: Tue, 31 Jul 2012 12:12:00 -0000 From: Gary Benson To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA 4/4 take 2] Improved linker-debugger interface Message-ID: <20120731121149.GA4756@redhat.com> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: <20120719110518.GE16185@redhat.com> <87394fhbv1.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87394fhbv1.fsf@fleche.redhat.com> 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-07/txt/msg00794.txt.bz2 Tom Tromey wrote: > >>>>> "Gary" == Gary Benson writes: > > Gary> +static struct probe_and_info * > Gary> +solib_event_probe_at (struct svr4_info *info, struct bp_location *loc, > Gary> + struct probe_and_info *result) > > I think this would be clearer if it just returned a boolean. > > Gary> + if (probe_argc == 2) > Gary> + action = NAMESPACE_RELOAD; > Gary> + else if (probe_argc < 2) > Gary> + return NAMESPACE_TABLE_INVALIDATE; > Gary> + > Gary> + return action; > > Perhaps that first 'return' could be an assignment to 'action'. > > Gary> +static hashval_t > Gary> +hash_namespace (const PTR p) > > Use 'void *' instead of PTR. This occurs in a few spots. > PTR is obsolete. > > Gary> + const struct namespace *ns = (const struct namespace *) p; > > You don't need a cast here. > > Gary> + const struct namespace *ns1 = (const struct namespace *) p1; > Gary> + const struct namespace *ns2 = (const struct namespace *) p2; > > Here either. > > Gary> + struct namespace *ns = (struct namespace *) p; > > Here either. > > Gary> + ns = xcalloc (sizeof (struct namespace), 1); > > I think it is more normal to use XCNEW (struct namespace) here. > xcalloc with 1 element is "funny". There's a lot of odd little > macros like this, used inconsistently... Attached is an updated version of this patch with these fixes. > The rest of the patch looks good to me. However, I think we should > refrain from putting it in until the probes go in to glibc. If this > makes a chicken-and-egg problem somehow, we can suggest simultaneous > approval or the like. Probes are in glibc as of Friday: http://sourceware.org/ml/libc-alpha/2012-07/msg00557.html Cheers, Gary -- http://gbenson.net/