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


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.

 > Currently these types are conditionally defined based on GDBSERVER.
 > The long term goal is to remove all such tests; however, this is
 > difficult as currently gdb uses definitions from BFD.  In the meantime
 > this is still a step in the right direction.
 > 
 > gdb/
 > 2014-08-01  Tom Tromey  <tromey@redhat.com>
 > 	    Gary Benson  <gbenson@redhat.com>
 > 
 > 	* common/common-types.h: New file.
 > 	* Makefile.in (HFILES_NO_SRCDIR): Add common/common-types.h.
 > 	* common/common-defs.h: Include common-types.h.
 > 	* defs.h (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST)
 > 	(ULONGEST): Remove.
 > 
 > gdb/gdbserver/
 > 2014-08-01  Tom Tromey  <tromey@redhat.com>
 > 	    Gary Benson  <gbenson@redhat.com>
 > 
 > 	* server.h: Add static assertion.
 > 	(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
 >[...]
 > diff --git a/gdb/common/common-types.h b/gdb/common/common-types.h
 > new file mode 100644
 > index 0000000..9fa1c24
 > --- /dev/null
 > +++ b/gdb/common/common-types.h
 > @@ -0,0 +1,61 @@
 > +/* Declarations for common types.
 > +
 > +   Copyright (C) 1986-2014 Free Software Foundation, Inc.
 > +
 > +   This file is part of GDB.
 > +
 > +   This program is free software; you can redistribute it and/or modify
 > +   it under the terms of the GNU General Public License as published by
 > +   the Free Software Foundation; either version 3 of the License, or
 > +   (at your option) any later version.
 > +
 > +   This program is distributed in the hope that it will be useful,
 > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
 > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 > +   GNU General Public License for more details.
 > +
 > +   You should have received a copy of the GNU General Public License
 > +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 > +
 > +#ifndef COMMON_TYPES_H
 > +#define COMMON_TYPES_H

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


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