This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

Re: glibc 2.1.3: elf_gregset_t


   Date: Mon, 14 Feb 2000 12:33:03 -0500
   From: Jim Kingdon <kingdon@redhat.com>

   Here is another fix to the elf_gregset_t problem, from Jakub Jelenc.
   I think I like this fix better than
   http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00047.html

   There are basically two differences:

   (1) the msg00047 patch contains many other cleanups to the
     i386-linux-nat.c file.  I briefly read/skimmed them and didn't see
     any surprises but I didn't look that closely.

While it would probably have been sensible for me to have split out
the meat from the cleanups, I really think the cleanups are
important.  Lot of comments in i386-linux-nat.c are not really
appropriate, and sometimes even misleading.

   (2) the enclosed patch tries to keep working with glibc2.0 (if I am
       correctly reading the ifdefs).  This strikes me as important.

I'm pretty sure this attempt us unecessary.  <asm/elf.h>, which is the
relevant Linux header file (at least those for stable Linux kernels
that have ELF support, so everything since 2.0) have *always* defined
the elf_gregset_t and elf_fpregset_t types.  The header also defines
gregset_t and fpregset_t (for user space only).  These were probably
added for GDB, because the Linux port of GDB did use some SVR4 code.
Unfortunately, in glibc 2.1, the <ucontext.h> header does also define
gregset_t and fpregset_t, but these definitions are incompatible with
the versions prefixed with elf_.  This lead to header clashes, so
glibc has its own header <sys/elf.h> which doesn't define gregset_t
and fpregset_t anymore.  That's the reason why GDB doesn't compile
anymore and a change is needed in the first place.

Anyway, using elf_gregset_t and elf_fpregset_t should work on all
Linux systems regardless if they use libc5, glibc 2.0 or glibc 2.1,
and my patch contains a comment that explicitly says so.

Also, core-regset.c isn't used anymore on Linux/i386.

The bottomline is, that I'd vote against using this patch.  Just
replacing gregset_t with elf_gregset_t (and fpregset_t with
elf_fpregset_t) in i386-linux-nat.c should be enough.  But I'd really
appreciate if someone could look at my origional patch.  IMHO the
cleanup is really essential for the long-term maintainability of the
Linux/i386 native port, and I'm willing to do the extra work that it
would take to adapt any unapplied patches (such as Tom Tromey's patch
to make things work again on Linux 2.0) after my patch has been applied.

Mark

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