This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 4/5 v7] Introduce common-debug.h
- From: Gary Benson <gbenson at redhat dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>, "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Wed, 20 Aug 2014 09:52:43 +0100
- Subject: Re: [PATCH 4/5 v7] Introduce common-debug.h
- Authentication-results: sourceware.org; auth=none
- References: <20140819091220 dot GB6493 at blade dot nx> <1408490530 dot 31355 dot 15 dot camel at ubuntu-sellcey>
[Cc'ing Mike and Frank (SIM global maintainer and SIM common
maintainer)]
Steve Ellcey wrote:
> On Tue, 2014-08-19 at 10:12 +0100, Gary Benson wrote:
> > > > 2014-08-13 Tom Tromey <tromey@redhat.com>
> > > > Gary Benson <gbenson@redhat.com>
> > > >
> > > > * common/common-debug.h: New file.
> > > > * common/common-debug.c: Likewise.
> > > > * debug.c: Likewise.
> > > > * Makefile.in (SFILES): Add common/common-debug.c.
> > > > (HFILES_NO_SRCDIR): Add common/common-debug.h.
> > > > (COMMON_OBS): Add common-debug.o and debug.o.
> > > > (common-debug.o): New rule.
> > > > * common/common-defs.h: Include common-debug.h.
> > > > * common/agent.c (debug_agent_printf): New function.
> > > > (DEBUG_AGENT): Redefine.
> > > > * nat/i386-dregs.c (debug_printf): Undefine.
>
> I just built gdb for mips (mips-linux-gnu and mips-mti-linux-gnu)
> and it died with:
>
> /local/home/sellcey/gcc/non_mti_linux/src/binutils-gdb/sim/mips/../common/sim-trace.c:1326: multiple definition of `debug_printf'
> common-debug.o:/local/home/sellcey/gcc/non_mti_linux/src/binutils-gdb/gdb/common/common-debug.c:31: first defined here
> collect2: ld returned 1 exit status
> make[1]: *** [gdb] Error 1
>
> I am assuming it has something to do with this patch.
Yeah. This patch adds a "debug_printf" function to GDB, but it looks
like SIM already had one.
I don't see any callers for SIM's debug_printf. Is this dead code
that can be removed, or is it provided as a convenience/library
function?
Steve, you can probably work around this for now by adding:
#define debug_printf gdb_debug_printf
at the top of GDB's common/common-debug.h. If SIM's debug_printf
cannot be removed then maybe we will have to add some hack like
this to GDB permanently.
Thanks,
Gary
--
http://gbenson.net/