This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Amusing problem in current libthread_db
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb at sources dot redhat dot com, libc-alpha at sources dot redhat dot com
- Date: Tue, 3 Jun 2003 18:09:12 -0400
- Subject: Amusing problem in current libthread_db
In recent versions of libthread_db, there's this interesting code:
td_err_e
td_thr_getgregs (const td_thrhandle_t *th, prgregset_t gregs)
{
struct _pthread_descr_struct pds;
LOG ("td_thr_getgregs");
if (th->th_unique == NULL)
{
/* No data yet. */
memset (gregs, '\0', sizeof (prgregset_t));
return TD_OK;
}
So, if we don't have a th_unique, claim to have no registers. So for the
first thread, until the thread manager is initialized [for LinuxThreads at
least - is it initialized earlier in NPTL?], we claim that all
registers are zero. GDB loads the registers during this interval.
So it thinks the PC is zero. Anyone know the reason for this change, which
appears to have come in with:
date: 2002/07/16 03:35:49; author: drepper; state: Exp; lines: +7 -0
Some more changes to handle TLS-enabled libpthread.
It doesn't seem to cause any problems, which baffles me just a little bit.
I'm still trying to figure that part out.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer