This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 3/9] add target method delegation
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Dec 2013 16:16:58 +0000
- Subject: Re: [PATCH v4 3/9] add target method delegation
- Authentication-results: sourceware.org; auth=none
- References: <1382464769-2465-1-git-send-email-tromey at redhat dot com> <1382464769-2465-4-git-send-email-tromey at redhat dot com> <526E8B54 dot 8040104 at redhat dot com> <87eh75cmig dot fsf at fleche dot redhat dot com> <87a9htcme3 dot fsf at fleche dot redhat dot com> <87habz7q6g dot fsf at fleche dot redhat dot com> <527D1A84 dot 9040106 at redhat dot com> <87lhzr11wz dot fsf at fleche dot redhat dot com> <87a9g623cw dot fsf at fleche dot redhat dot com> <871u1gz9q2 dot fsf at fleche dot redhat dot com> <52AEFB0A dot 3090104 at redhat dot com> <87r49cpk54 dot fsf at fleche dot redhat dot com>
On 12/16/2013 09:21 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> 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