This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 30/32] convert to_search_memory
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 14 Jan 2014 13:20:35 -0700
- Subject: Re: [RFC 30/32] convert to_search_memory
- Authentication-results: sourceware.org; auth=none
- References: <1389640367-5571-1-git-send-email-tromey at redhat dot com> <1389640367-5571-31-git-send-email-tromey at redhat dot com> <52D593CA dot 5020704 at redhat dot com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>> - if ((*t)->to_can_run && target_can_run (*t))
>> + if ((*t)->to_can_run != delegate_can_run && target_can_run (*t))
Pedro> OOC, I'm wondering how you envision translating checks
Pedro> like this into a C++ world?
Good question.
Code like this only appears in places like find_default_run_target.
These functions iterate over all the target_ops structures to find a
suitable one to return.
In the multi-target model, this idea does not really work. Abstractly,
find_default_run_target is returning a type, not an instance; but in the
long run we want most of the code to deal solely with instances. I'm
not sure if this way of putting it makes sense... basically
find_default_run_target can't return an instance of a target, but in
order to do nearly anything useful with a target (in the multi-target
future) the target must be instantiated to have an object with state.
This means we're already going to need some restructuring in this area.
So, while a straightforward translation to C++ is not really possible, I
suspect it will also not be needed.
But, if it is needed in the end, I think it can be done simply by adding
fields to target_ops.
Tom