This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 04/15 v2] Introduce common-types.h
- From: Doug Evans <dje at google dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 17 Jul 2014 10:02:14 +0100
- Subject: Re: [PATCH 04/15 v2] Introduce common-types.h
- Authentication-results: sourceware.org; auth=none
- References: <1405520243-17282-1-git-send-email-gbenson at redhat dot com> <1405520243-17282-5-git-send-email-gbenson at redhat dot com>
On Wed, Jul 16, 2014 at 7:17 AM, Gary Benson <gbenson@redhat.com> wrote:
> This introduces common-types.h. This file defines various standard
> types used by gdb and gdbserver.
>
> 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-07-16 Tom Tromey <tromey@redhat.com>
> Gary Benson <gbenson@redhat.com>
>
> * common/common-types.h: New file.
> * nat/linux-ptrace.c: Include common-types.h.
> * defs.h: Include common-types.h.
> (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST, ULONGEST): Remove.
>
> gdb/gdbserver/
> 2014-07-16 Tom Tromey <tromey@redhat.com>
>
> * server.h: Include common-types.h. Move gdb_assert.h include
> earlier. Add static assertion.
> (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
LGTM
One nit for discussion's sake.
CORE_ADDR for gdbserver is a native value, whereas in gdb it's a
target value. That's why the static assert (sizeof (CORE_ADDR) >=
sizeof (void *)) isn't in common code (IIUC - e.g., consider a
64-cross-32 gdb). I don't think that'll ever be a problem, and if it
does become one we can address it then. Just thinking out loud ...