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: [PATCH 02/11 v5] Introduce common-types.h


Doug Evans wrote:
> Gary Benson writes:
> > This introduces common-types.h.  This file defines various standard
> > types used by gdb and gdbserver.
> 
> Side discussion: It's a bit odd to see common-types.h and then see
> errors.h spelled as errors.h and not common-errors.h.
> [Or vice versa.]
> 
> Is consistency in the file names a goal?
> I realize common-utils.h needs to be something other than utils.h
> because gdb and gdbserver each still have their own.
> And similarly for common-defs.h - gdb still has defs.h.
> But nothing else in common/ is spelled common-foo,
> and I wonder if less randomness would be useful.
> I'd be happy with #include "common/errors.h", and so on.
> That way when I see it used I know where to look without having to
> rely on memory or ls.

Less randomness would be useful.  I would like to remove -Icommon
from the CFLAGS of both GDB and gdbserver and reference all headers
as:

  #include "common/errors.h"
  #include "common/types.h"

I have a script that automates the rewriting, including renaming all
files under common/ with "common-" and "gdb_" prefixes and "-common"
suffixes and modifying the Makefiles to suit.  I intend to run it and
submit a patch once this series and the series it now depends on
(https://sourceware.org/ml/gdb-patches/2014-07/msg00736.html) are
approved and pushed.

> Nit, and I do mean nit :-): errors.h uses COMMON_ERRORS_H,
> so should this be COMMON_COMMON_TYPES_H?

No, because of the above :)

Cheers,
Gary

-- 
http://gbenson.net/


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