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: Is elf_gregset_t the correct type for all Linuxen?


   Date: Wed, 24 May 2000 13:33:30 -0700
   From: Michael Snyder <msnyder@cygnus.com>

   We have a function supply_gregset which is defined in a
   number of *-linux-nat.c files.  There's some confusion
   about the data type of it's argument.  In many instances
   it is defined as "gregset_t", but I understand that that
   data type is used in several places in Linux and is not
   always defined in the same way.

Yes.  It's similar to Solaris where you have gregset_t (used for user
contexts) and prgregset_t (used in the proc interface and core dumps),
except that some libc versions use the gregset_t type for both.  To
add to the confusion recent versions of glibc also typedef
prgregset_t, and this was broken on i386 for prfpregset_t with glibc
2.1.3.

   Now, i386-linux-nat.c uses a different data type for
   this function, "elf_gregset_t".  I'm wondering if all
   the flavors of Linux gdb should be using this type
   as well?

All Linux architectures define elf_gregset_t, and AFAICT this always
is the right definitions to use for core dumps and in ptrace requests.
On architectures other than the i386 gregset_t will probably work,
unless the i386 implementation was blindly copied.

Mark

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