From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5942 invoked by alias); 17 Dec 2013 16:17:08 -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 5928 invoked by uid 89); 17 Dec 2013 16:17:06 -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; Tue, 17 Dec 2013 16:17:06 +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 rBHGH4a8026433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Dec 2013 11:17:04 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBHGGxti016275; Tue, 17 Dec 2013 11:17:04 -0500 Message-ID: <52B078FA.8040004@redhat.com> Date: Tue, 17 Dec 2013 16:17: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: [PATCH v4 3/9] add target method delegation References: <1382464769-2465-1-git-send-email-tromey@redhat.com> <1382464769-2465-4-git-send-email-tromey@redhat.com> <526E8B54.8040104@redhat.com> <87eh75cmig.fsf@fleche.redhat.com> <87a9htcme3.fsf@fleche.redhat.com> <87habz7q6g.fsf@fleche.redhat.com> <527D1A84.9040106@redhat.com> <87lhzr11wz.fsf@fleche.redhat.com> <87a9g623cw.fsf@fleche.redhat.com> <871u1gz9q2.fsf@fleche.redhat.com> <52AEFB0A.3090104@redhat.com> <87r49cpk54.fsf@fleche.redhat.com> In-Reply-To: <87r49cpk54.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00653.txt.bz2 On 12/16/2013 09:21 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > >>> 3. de_fault will be completely eliminated. INHERIT will be limited to >>> the smallest possible list of fields, like to_shortname. Nearly >>> every current_target method will simply delegate. > > Pedro> Sounds like the squashed target will end up mostly unused? It sounds > Pedro> to me that even for those (data fields) we wouldn't need INHERIT. As > Pedro> all targets have a name, e.g., target_shortname could be made a method > Pedro> that returns the name of the currently topmost target in the stack > Pedro> (not the squashed target). > > Yeah. The squashed target may still need to exist, or the debug target > would have to be recast as a new stratum. Yeah. It's always been silly that "set debug target" only works if specified before opening/pushing the target. >>> 5. Any given to_* method implementation will be guaranteed to be called >>> with the target_ops with which it was registered. (This rule is >>> handy on multi-target, where I split out the target_ops vtable from >>> the object itself.) > > FWIW I wrote a script to add all the missing "this" arguments -- not > just to target.h but to every method implementation in the tree. Nice! > This yields 103 patches -- one per converted method. (I may zap a few > of these, the bulk of them seem to make sense...) I'm not quite sure > how to submit it. I mean, email is doable, but it seems a bit large. > Yeah, not sure either... squash a few; post only the non-trivial ones as email; post all of them at once anyway; split in 4 or 5 batches. Whatever really is fine with me. > The nice thing about these refactorings is that the needed changes are > usually trivial anyhow. Yeah. -- Pedro Alves