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: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 17 Jul 2014 10:40:37 -0600
- 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>
>>>>> "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.
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.
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.
Tom