[RFC] auto-generate most target debug methods
Pedro Alves
palves@redhat.com
Thu Jul 17 16:52:00 GMT 2014
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
More information about the Gdb-patches
mailing list