Fw: GDB 5.0 won't build on GNU/Linux/sparc
Mark Kettenis
kettenis@wins.uva.nl
Thu Jun 1 17:32:00 GMT 2000
From: "Michael Snyder" <msnyder@cygnus.com>
Date: Thu, 1 Jun 2000 16:12:56 -0700
>Alexandre Oliva wrote in message ...
>>gdb/sparc-tdep.c contains code in supply_gregset() and fill_gregset()
>>that will only compile on Solaris/sparc. glibc doesn't define
>>prgreg_t, R_I7, R_PS, R_PC, R_nPC nor R_Y. In fact, registers from i0
>>to i7 aren't even available in glibc's gregset
>
>Hmmm... now that I think about it...
>
>Alexandre, is this (linux/sparc) a new port? sparc-tdep.c has always
>contained unprotected references to prgregset_t, R_nPC and R_Y.
>I don't quite understand why this problem hasn't shown up before now.
>
>Of course, if your port doesn't use supply_gregset etc., then there's no
>problem with you ifdeffing it out as you have suggested (by undefining
>USE_PROC_FS).
>
The gregset_t confusion strikes again :-( The gregset_t type in
<sys/ucontext.h> isn't relevant for GDB. It's the gregset_t type from
<sys/procfs.h> that folks should be looking at in this context, or
rather the elf_gregset_t from asm/elf.h. Then you'll see that i0 to
i7 *are* available, at least in core dumps, and that the layout of the
core-dumps is very similar to Solaris. However, the ptrace interface
seems to be a little different.
The gregset_t type should be removed from <sys/procfs.h> (just as the
<sys/ucontext.h> include) and only the prgregset_t (and perhaps
elf_gregset_t) type should be made available from it.
I think supply_gregset() and friends are necessary for the new threads
support, and that the copies from sparc-tdep.c could be used on Linux
for that. But the person who's going to fix the GDB Linux/Sparc port
should first clean up the gregset_t mess, otherwise it'll drive
him/her crazy.
Mark
More information about the Gdb-patches
mailing list