This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Remove START_INFERIOR_TRAPS_EXPECTED macro from nm header


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, &current_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, &current_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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]