This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC 00/32] clean up target delegation


On 01/13/2014 07:12 PM, Tom Tromey wrote:

> After this patch, nearly every remaining INHERIT is for a scalar
> field.  I think it would be worth eliminating these as well; the
> simplest would seem to be to convert each to a new target method.  I'm
> happy to do this if others agree.

For a couple, I think the simplest yet would be to change their
respective macros/functions to return the field in the topmost target:

-#define	target_shortname	(current_target.to_shortname)
-#define	target_longname		(current_target.to_longname)
+#define	target_shortname	(current_target.beneath->to_shortname)
+#define	target_longname		(current_target.beneath->to_longname)

Actually, it seems to be that most, if not all, hacks^W uses
of target_shortname are wrong, in that they want to know the
name of the process_stratum target, not the topmost target.

to_doc is never used in the squashed target, so we just can
stop inheriting that.

to_attach_no_wait does indeed look like best be made a method that
delegates, as it may not be topmost target that handles that
to_attach detail (it'll usually be the process_stratum target).
Same for to_have_steppable_watchpoint, to_have_continuable_watchpoint
and to_has_thread_control.

> The remaining method using INHERIT is deprecated_xfer_memory.  This is
> also a method not using delegation or getting the "target_ops"
> treatment.  I didn't bother with this one because my understanding is
> that Pedro is working on eliminating this method entirely.

Yeah.  There's deprecated_xfer_memory branch on my github that
does that.  Needs writing ChangeLog's and posting...

> There are also three remaining uses of de_fault: to_open, to_close,
> and deprecated_xfer_memory.  to_open and to_close are just special.

target_open and target_close are always called on a specific real target
OPS, never on the squashed &current_target.  ISTM these de_fault's are
useless and can just be removed, even on current mainline.

> They may need some work for the multi-target feature, but I didn't
> want to attempt it now.  deprecated_xfer_memory, again, is hopefully
> just going away.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]