This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/11 v5] Introduce common-types.h
- From: Gary Benson <gbenson at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Wed, 6 Aug 2014 17:48:11 +0100
- Subject: Re: [PATCH 02/11 v5] Introduce common-types.h
- Authentication-results: sourceware.org; auth=none
- References: <1406888377-25795-1-git-send-email-gbenson at redhat dot com> <1406888377-25795-3-git-send-email-gbenson at redhat dot com> <21474 dot 22819 dot 191021 dot 27602 at ruffy dot mtv dot corp dot google dot com>
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/