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: Mike Frysinger <vapier at gentoo dot org>
- Cc: Steve Ellcey <sellcey at mips dot com>, Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Wed, 20 Aug 2014 20:14:37 +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> <15329331 dot NicJ8HFAzI at vapier> <20140820120934 dot GA26854 at blade dot nx> <2738453 dot Usiax8h3c8 at vapier>
Mike Frysinger wrote:
> On Wed 20 Aug 2014 13:09:34 Gary Benson wrote:
> > Mike Frysinger wrote:
> > > On Wed 20 Aug 2014 09:52:43 Gary Benson wrote:
> > > > 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.
> > >
> > > i'm fine with updating sim/common/sim-trace.h with that idea:
> > > #define debug_printf sim_debug_printf
> > >
> > > all the symbols coming out of the sim really should be namespaced
> >
> > Great. I can put together a patch if you like (or I can make the
> > change, or you can... whatever's easiest!) I don't know much about
> > SIM... is there a list to mail patches to? And, is its upstream
> > repo the same as binutils+GDB or is it imported from somewhere else
> > like libiberty?
>
> it would be great if you could put together the patch :). sim
> patches go to the same place as gdb (same repo), and i can approve
> them when i see them.
Inlined below. I'm away til Tuesday now, but I'll try and check my
email before I go so if I see you and Frank are happy with this then
I'll commit it. If I don't, feel free to commit it yourself or wait
(I'm happy with either).
Thanks,
Gary
--
2014-08-20 Gary Benson <gbenson@redhat.com>
* sim-trace.h (debug_printf): New define.
diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h
index 5fb58e1..69fffb4 100644
--- a/sim/common/sim-trace.h
+++ b/sim/common/sim-trace.h
@@ -583,6 +583,9 @@ extern void trace_vprintf (SIM_DESC, sim_cpu *, const char *, va_list);
/* Non-zero if "--debug-insn" specified. */
#define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX)
+/* GDB also has a debug_printf, so we shadow ours. */
+#define debug_printf sim_debug_printf
+
extern void debug_printf (sim_cpu *, const char *, ...)
__attribute__((format (printf, 2, 3)));