This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] auto-generate most target debug methods
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 17 Jul 2014 17:46:21 +0100
- Subject: Re: [RFC] auto-generate most target debug methods
- Authentication-results: sourceware.org; auth=none
- References: <1403208237-27023-1-git-send-email-tromey at redhat dot com> <53C5042B dot 6080406 at redhat dot com> <87sim1z71y dot fsf at fleche dot redhat dot com> <53C7E1D8 dot 7060808 at redhat dot com> <87k37cx996 dot fsf at fleche dot redhat dot com> <53C7F7A8 dot 8040505 at redhat dot com> <87d2d4x7ju dot fsf at fleche dot redhat dot com>
On 07/17/2014 05:40 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
>>> have extra arguments (I happened to see target_get_section_table).
>
> Pedro> Hmm, I think you might have looked at some other method. That
> Pedro> one's arguments seem to match.
>
> Sorry, I wasn't totally clear.
> That particular function takes a target_ops parameter -- but generally
> the target_* entry points do not.
Ah.
>
> Pedro> But yeah, there's some missing uniformity here. E.g.,
> Pedro> target_terminal_inferior is currently horrible for actually
> Pedro> bypassing calling the target method in some cases. target_detach
> Pedro> is another case that does extra work.
>
> Another somewhat related oddity in the current code is that some spots
> bypass these entry points, or at least seem to. Search for
> "current_target.beneath" outside of target.[ch] to see.
Yeah, most of those are related to xfer_partial. I wrote somewhere
that I thought we can actually make that one a regular delegated
method now, but I don't have the pointer handy, nor do I off hand
recall why. But I can look it up if you want me to.
>
> Pedro> I was thinking simpler maintenance and clearer resulting code, by
> Pedro> enforcing the rule that the entry point does nothing more than
> Pedro> calling the target_ops method, to avoid surprises like
> Pedro> target_terminal_inferior.
>
> Yeah, ok. Well, that makes sense, it's just unclear to me if the
> cost/benefit ratio is in our favor here, given the apparent amount of
> inconsistency already in-tree.
Yeah, agreed. It was just a thought, brainstorming material.
I'm definitely not going to jump right into attempting it.
--
Pedro Alves