Re: [PATCH v5 1/8] Move utility functions to common/

Doug Evans
2014-05-19T22:46:01Z

On Sun, May 18, 2014 at 12:05 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Mon, 24 Mar 2014 20:59:48 +0100, Sergio Durigan Junior wrote:
>> On Wednesday, March 19 2014, Jan Kratochvil wrote:
>> > some parts of the former patch have been reimplemented in the meantime by
>> > other patches so this is only a part of the former cleanup.
>>
>> Can't this go in independently? I think they are nice cleanups.
>
> I do not think it is right without the later parts of the patchset - code
> in gdb/common/ should be used by both gdb and gdbserver. Otherwise the code
> could remain in gdb/ only.

Hi.
I don't have a strong opinion on whether this particular patch can go
in right away, but I do have a comment.
I think we're building gdb wrong (where by "gdb" I mean
gdb+gdbserver+gdbreplay+...) if things can't go in common if they're
only used by gdb.
We should be building gdb out of useful building blocks, and it's just
easier to hack if said building blocks are already available, without
having to go through all the administrivia of moving them about or
what not.

If something like skip_spaces isn't used by gdbserver today, that
doesn't mean it won't be tomorrow.
IOW, I think of "common" as a collection of application-independent
routines, not dissimilar from libiberty, but for whatever reason
doesn't/can't live there instead. [btw, I'm not suggesting moving
routines from common to libiberty, but I'm guessing a quick glance
would find a few that should just as well live in libiberty - and be
usable by more people too]

Plus, I guess I have to ask, if down the road we find some routine in
common only used by a particular app, do we need to move it out of
common and into that app's directory?

My $0.02 anyways.