This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: rs6000-tdep should probably not depend on the ppc-sim code
> the sim is a looooooooong way off from supporting --enable-targets=all. only
> sane thing to do is to have the ppc gdb code not enable the sim logic if the
> default target is non-powerpc. but i'm not sure if the current gdb framework
> provides any information for that.
>
> #if WITH_SIM && (DEFAULT_BFD_ARCH == bfd_rs6000_arch)
> ...
> #endif
>
> obviously this won't work in actual CPP code. not sure sure if the gdb peeps
> have workable suggestions short of opencoding some logic in configure.tgt to
> append a unique -D to CPPFLAGS to tell the code to not enable things.
>
> relying on the compiler's DCE and doing:
> if (WITH_SIM && DEFAULT_BFD_ARCH == bfd_rs6000_arch)
> wouldn't work with lower optimization levels :(
Just throwing some ideas, since I don't really have a clear idea
of the best way to fix this. Could the sim provide an include that
says which sims are being provided? That way, we would have:
#ifdef WITH_SIM
#include "sim/something.h"
#endif
#if WITH_SIM && PPC_SIM_ENABLED
...
#endif
The idea would be to avoid duplicating in GDB's configure the logic
that's in the sim's configure...
Or another way: turn that logic into a macro, and share it between
sim and GDB?
--
Joel