Re: [RFA] Remove unnecessary target defaults.

Vladimir Prus
2008-08-15T15:02:53Z

On Friday 15 August 2008 18:52:19 Pedro Alves wrote:
> On Friday 15 August 2008 15:40:53, Vladimir Prus wrote:
>
> > > It sounds sound to me. This would be like a generalised version of
> > > inf-child.c, from which all targets that can have execution
> > > inherit.
> >
> > Well, actually, I meant implementing target_can_async_p in such a way that
> > it:
> >
> > - iterates over all targets
> > - breaks after it examines a target at process stratum
> >
>
> Should work too...
>
> > Of course, we can also have a common target, but it would require manually
> > adjusting all target on process stratum.
>
> ... yeah. I keep meaning to try adding a base target from which all
> targets inherit, so we could perhaps get rid of this INHERIT +
> de_fault business, and I somehow thought you could read minds. Well,
> you do, but you set it to block dumb ideas. :-)

In fact, I cannot shake the feeling that current target stack is several
designs lumped together, and it would be beneficial to switch to a more coherent
design, where, in particular:

- there's base target every other target derives from and most methods of the base
target forward to the target beneath
- dummy target catches all methods
- all INHERIT and de_fault code is removed
- all target_xxx methods (iterating over target stack) are removed, or make just call
current_target->xxx

But this is fairly large thing to do.

- Volodya