This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 10/11 v5] Remove GDBSERVER uses from i386-dregs.c
- 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: Thu, 7 Aug 2014 13:28:05 +0100
- Subject: Re: [PATCH 10/11 v5] Remove GDBSERVER uses from i386-dregs.c
- Authentication-results: sourceware.org; auth=none
- References: <1406888377-25795-1-git-send-email-gbenson at redhat dot com> <1406888377-25795-11-git-send-email-gbenson at redhat dot com> <21474 dot 29901 dot 308670 dot 5969 at ruffy dot mtv dot corp dot google dot com>
Doug Evans wrote:
> Gary Benson writes:
> > -#ifndef GDBSERVER
> > /* Whether or not to print the mirrored debug registers. */
> > extern int debug_hw_points;
> > -#endif
>
> Since externs should live in headers, and since this is a cleanup
> patch, can I impose on you a request to move debug_hw_points to a
> header. Seems like i386-dregs.h is the best place.
>
> The variable could even arguably be defined in i386-dregs.c, though
> I'm not sure if/how people would want i386-nat.c to change. Plus
> add x86 or some such to the variable's name. I'd leave this part to
> another pass.
i386-dregs doesn't work for debug_hw_points, as it's also used by
the aarch64-linux code. It's handled fairly messily at present
(it's global in gdbserver, in server.[ch], but local to some ports
in GDB) which I guess I why I left it why it was when I did the
i386-dregs work.
Since it's global in gdbserver it probably should just be global.
I'll move the extern to common-debug.h, and the definition to
common-debug.c.
Thanks,
Gary
--
http://gbenson.net/