This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Problems with LinuxThreads support in GDB...
- To: scottb at netwinder dot org
- Subject: Re: Problems with LinuxThreads support in GDB...
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Mon, 13 Mar 2000 23:09:49 +0100 (MET)
- CC: gdb at sourceware dot cygnus dot com
- References: <38C92CBD.178D0A1E@netwinder.org>
Date: Fri, 10 Mar 2000 12:11:25 -0500
From: Scott Bambrough <scottb@netwinder.org>
Ok. I attempted to put the linuxthreads support in last night. It
was relatively painless, but I have reached a stumbling block with
glibc 2.1.2. In gdb_proc_service.h there are the following two
definitions:
#ifndef HAVE_PRGREGSET_T
typedef gregset_t prgregset_t; /* BOGUS BOGUS BOGUS */
#endif
#ifndef HAVE_PRFPREGSET_T
typedef fpregset_t prfpregset_t; /* BOGUS BOGUS BOGUS */
#endif
The BOGUS comments are accurate. Neither gregset_t or fpregset_t
are defined in <sys/procfs.h>. prgregset_t and prfpregset_t are
also used in gdb_threads_db.h as well without checking the defines
from config.h. I'm trying this on 2.1.3 ATM, but for the most
part, the installed base of users is using 2.1.2 on ARM Linux. Any
thoughts on how I could get around this?
Well, those definitions would be appropriate for a SVR4 system, that
has a unique register set type that's used throughout the system. It
is also correct for most of the older Linux systems. It isn't correct
for Solaris but Solaris does have the pr-prefixed types (in fact that
is the reason why those types were introduced).
Anyway, what you (read the Linux/ARM community) need to do is to
choose the appropriate types for passing around register sets. Things
would be most convenient if there are types that can be used in
ptrace() calls and are also used to store register sets in (ELF) core
dumps.
On the Linux/i386 (and most of the other ports) there are such types,
and their names are elf_gregset_t and elf_fpregset_t. It is likely
that these types also work for Linux/ARM, but be sure to take a look
at the kernel sources to verify this. Make sure that the glibc headers
match your findings. Since <sys/procfs.h> does a `typedef fpregset_t
prfpregset_t' this header's probably not right (the `typedef gregset_t
prgregset_t' is probably not going to cause you any trouble, but using
the elf_-prefixed types is likely to be better). The bottomline is
that a GDB compiled against an unpatched glibc 2.1.3 is not very
likely to work (the same sitiuation exists on Linux/i386).
To support glibc 2.1.3 you'd probably better take the approach taken
in procfs.c and introduce the GDB_GREGSET_TYPE macro. Then in the ARM
specific nm-linux.h define this to the apropriate type, and add the
necessary magic to gdb_thread_db.h.
If you want to know more at the issues with the register types, please
take a look at the notes I sent to one of the glibc mailing lists at:
http://sourceware.cygnus.com/ml/libc-hacker/2000-02/msg00065.html
Mark