This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 05/15] Introduce and use debug_printf and debug_vprintf
- From: Gary Benson <gbenson at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 15 Jul 2014 16:21:13 +0100
- Subject: Re: [PATCH 05/15] Introduce and use debug_printf and debug_vprintf
- Authentication-results: sourceware.org; auth=none
- References: <1404902255-11101-1-git-send-email-gbenson at redhat dot com> <1404902255-11101-6-git-send-email-gbenson at redhat dot com> <21440 dot 16038 dot 443276 dot 765473 at ruffy dot mtv dot corp dot google dot com>
Doug Evans wrote:
> Gary Benson writes:
> > 2014-07-09 Tom Tromey <tromey@redhat.com>
> > Gary Benson <gbenson@redhat.com>
> >
> > * common/common-debug.h: New file.
> > * utils.h: Include common-debug.h.
> > * utils.c (debug_vprintf): New function.
> > (debug_printf): Likewise.
> > * common/agent.c (debug_agent_print): New function.
> > (DEBUG_AGENT): Redefine.
> > * nat/i386-dregs.c (debug_printf): Undefine.
> >
> > gdb/gdbserver/
> > 2014-07-09 Tom Tromey <tromey@redhat.com>
> > Gary Benson <gbenson@redhat.com>
> >
> > * utils.h: Include common-debug.h.
> > * debug.h (debug_printf): Don't declare.
> > * debug.c (debug_vprintf): New function.
> > (debug_printf): Use the above.
>
> IWBN if there was more file naming consistency.
> As a general rule, how objectionable is it to have gdb/foo.c
> and gdbserver/foo.c for every shared foo.h header?
I like it.
> [Or common-foo.h header in the case of, e.g., common/common-debug.h.]
> An alternative would be to move common-debug.h to a new directory,
> e.g., shared, and call it shared/debug.h. I'm only mentioning this
> for discussion sake, it's not a requisite for this patch.
I have a script to automate the changes required so we can remove
"-I/path/to/gdb/common" from $CFLAGS. This would allow GDB and/or
gdbserver to have their own "foo.h" that could include "common/foo.h".
The script also removes all the "common-" and "gdb_" prefixes from
header files in common. I plan to submit a patch after this series
is in. This means this series is creating files that will almost
immediately be moved, but the alternative is I end up having to
extensively fix this series (and I already did that once already!)
> In this case, any objection to putting the gdb implementation
> in gdb/debug.c instead of utils.c?
No objection from me, I'll do it.
Thanks,
Gary
--
http://gbenson.net/