This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Remove START_INFERIOR_TRAPS_EXPECTED macro from nm header
- From: Pedro Alves <pedro at codesourcery dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org, pierre dot muller at ics-cnrs dot unistra dot fr
- Date: Tue, 22 Mar 2011 10:58:04 +0000
- Subject: Re: [RFC] Remove START_INFERIOR_TRAPS_EXPECTED macro from nm header
- References: <003e01cbe825$321015a0$963040e0$@muller@ics-cnrs.unistra.fr> <201103220934.26493.pedro@codesourcery.com> <201103221023.p2MANXYX027907@glazunov.sibelius.xs4all.nl>
On Tuesday 22 March 2011 10:23:33, Mark Kettenis wrote:
> If you really think that getting rid of the nm header files is
> something that has to be done (I'm not convinced it is), then perhaps
> you should simply add:
>
> MH_CFLAGS=-DSTART_INFERIOR_TRAPS_EXPECTED=3
>
> to the appropriate Makefile fragments. I'm not convinced that is an
> improvmenet though.
Yeah, but note that the H in MH_CFLAGS stands for _host_ --- macros
like START_INFERIOR_TRAPS_EXPECTED make sense for the native backend,
but not for a cross debugger built on that same host, so that isn't
super correct either.
Pierre, the macros that are evil and that we want to get rid of, are
those that affect common code. For example, SOLIB_ADD:
breakpoint.c:#ifdef SOLIB_ADD
breakpoint.c: SOLIB_ADD (NULL, 0, ¤t_target, auto_solib_add);
breakpoint.c: step over a dlopen call and SOLIB_ADD is resetting the
infcmd.c:#ifdef SOLIB_ADD
infcmd.c: SOLIB_ADD (NULL, 0, target, auto_solib_add);
infrun.c:#ifdef SOLIB_ADD
infrun.c: SOLIB_ADD (NULL, 0, ¤t_target, auto_solib_add);
infrun.c:#if defined(SOLIB_ADD)
solib-frv.c: SOLIB_ADD. SOLIB_ADD eventually calls this this function,
A GDB build that defines SOLIB_ADD (AIX is the only one) will be useless
and quite broken as a cross debugger (e.g., "target remote" to debug with
a Windows gdbserver), because SOLIB_ADD will expand to something that only
makes (some, but not much!) sense for the _native_ backend.
--
Pedro Alves