From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3417 invoked by alias); 25 Jul 2012 19:36:35 -0000 Received: (qmail 3407 invoked by uid 22791); 25 Jul 2012 19:36:34 -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; Wed, 25 Jul 2012 19:36:20 +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 q6PJaJhN004986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Jul 2012 15:36:19 -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 q6PJaIZ3005166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 25 Jul 2012 15:36:19 -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> Date: Wed, 25 Jul 2012 19:36:00 -0000 In-Reply-To: <20120719110518.GE16185@redhat.com> (Gary Benson's message of "Thu, 19 Jul 2012 12:05:18 +0100") Message-ID: <87394fhbv1.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-07/txt/msg00578.txt.bz2 >>>>> "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... 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. Tom