From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16191 invoked by alias); 15 Jan 2014 12:55:15 -0000 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 Received: (qmail 16096 invoked by uid 89); 15 Jan 2014 12:55:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2014 12:55:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0FCtC1P029722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jan 2014 07:55:12 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0FCtAUt017974; Wed, 15 Jan 2014 07:55:11 -0500 Message-ID: <52D6852E.6080400@redhat.com> Date: Wed, 15 Jan 2014 12:55:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [RFC 00/32] clean up target delegation References: <1389640367-5571-1-git-send-email-tromey@redhat.com> In-Reply-To: <1389640367-5571-1-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00502.txt.bz2 On 01/13/2014 07:12 PM, Tom Tromey wrote: > After this patch, nearly every remaining INHERIT is for a scalar > field. I think it would be worth eliminating these as well; the > simplest would seem to be to convert each to a new target method. I'm > happy to do this if others agree. For a couple, I think the simplest yet would be to change their respective macros/functions to return the field in the topmost target: -#define target_shortname (current_target.to_shortname) -#define target_longname (current_target.to_longname) +#define target_shortname (current_target.beneath->to_shortname) +#define target_longname (current_target.beneath->to_longname) Actually, it seems to be that most, if not all, hacks^W uses of target_shortname are wrong, in that they want to know the name of the process_stratum target, not the topmost target. to_doc is never used in the squashed target, so we just can stop inheriting that. to_attach_no_wait does indeed look like best be made a method that delegates, as it may not be topmost target that handles that to_attach detail (it'll usually be the process_stratum target). Same for to_have_steppable_watchpoint, to_have_continuable_watchpoint and to_has_thread_control. > The remaining method using INHERIT is deprecated_xfer_memory. This is > also a method not using delegation or getting the "target_ops" > treatment. I didn't bother with this one because my understanding is > that Pedro is working on eliminating this method entirely. Yeah. There's deprecated_xfer_memory branch on my github that does that. Needs writing ChangeLog's and posting... > There are also three remaining uses of de_fault: to_open, to_close, > and deprecated_xfer_memory. to_open and to_close are just special. target_open and target_close are always called on a specific real target OPS, never on the squashed ¤t_target. ISTM these de_fault's are useless and can just be removed, even on current mainline. > They may need some work for the multi-target feature, but I didn't > want to attempt it now. deprecated_xfer_memory, again, is hopefully > just going away. -- Pedro Alves