Re: patch to gdb on Tru64 5.1

Joel Brobecker
2001-05-10T17:03:00Z

> > Index: gdb/alpha-nat.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/alpha-nat.c,v
> > retrieving revision 1.7
> > diff -c -3 -p -r1.7 alpha-nat.c
> > *** alpha-nat.c 2001/03/06 08:21:05 1.7
> > --- alpha-nat.c 2001/05/09 05:33:21
> > ***************
> > *** 29,35 ****
> > #include <asm/reg.h>
> > #include <alpha/ptrace.h>
> > #else
> > ! #include <machine/reg.h>
> > #endif
> > #include <sys/user.h>
> > --- 29,35 ----
> > #include <asm/reg.h>
> > #include <alpha/ptrace.h>
> > #else
> > ! #include <alpha/coreregs.h>
> > #endif
> > #include <sys/user.h>
>
> Is this safe? Hmm, looking at that part of the header:
>
> #ifdef __linux__
> #include <asm/reg.h>
> #include <alpha/ptrace.h>
> #else
> #include <machine/reg.h>
> #endif
>
> the whole thing is somewhat bogus. Anyway, you need to be certain that
> your change doesn't break at least the immediatly previous OS.

I tried to compile the code on a machine running 4.0f, and it actually
works much better with this change.

> In the above, half of core_reg_mapping[] is determined by the macro
> NFC_REGS.
>
> Can you instead define both tables and select the correct one at
> runtime?

I don't understand your suggestion. The conditionalization is needed in
order to successfully compile on Tru64 5.1. If I had 2 tables, one of
them would not compile.

--
Joel