Re: [PATCH 12/15] Add target/symbol.h, update users

Gary Benson
2014-07-16T10:38:04Z

Doug Evans wrote:
> On Fri, Jul 11, 2014 at 5:56 AM, Gary Benson <gbenson@redhat.com> wrote:
> > Tom Tromey wrote:
> > > Doug> As target/* scales up, is there a risk of the code
> > > Doug> becoming harder to read if target_ is used as a general
> > > Doug> prefix for things in target/*? Dunno. Just wondering.
> > >
> > > My long term goal is that gdb and gdbserver share the entire
> > > target stack. I think these patches further this goal. I don't
> > > find the result harder to read at all.
> >
> > Doug, are you ok for me to leave it as it is, or, do you have an
> > alternative you would like me to implement instead?
>
> Hi. I'm not sure TBH. I think it might be ok as is, but IWBN to
> see the full patch with comments.

In this case, the implementations are in gdb/{,gdbserver/}target.c
so maybe it would make sense to have the prototype in
gdb/target/target.h--though this comes with the caveat that I don't
have a good idea of what sharing the entire target stack will mean
right now. It may be that Tom created the file anticipating other
functions that will go there in future. Doug, Tom, I'd appreciate
both your opinions on this.

Wherever it goes (and whatever it's called) I think there'll always be
a bit of jiggling around with a refactoring of this size and nature.
I think we need to prioritize getting the right subset of code shared
over getting the interface perfect or we risk premature optimization.
Doug, I realize that this paragraph could be read as "I don't share
your concerns" but please don't read it this way! I want a really
nice interface between the shared code (ie common/target/nat) and the
consumers (GDB and gdbserver). I'm anticipating various functions
being moved and/or renamed as the exact subset of code to be shared
becomes clearer.

Thanks,
Gary

--