Re: GDB doesn't display thread_id while debugging a core file

Carlos Eduardo Seo
2007-08-06T21:21:09Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Jacobowitz wrote:
> The thread ID is produced by NPTL's libthread_db library,
Yes, and this number is also an address, the thread pointer used to
access the TCB, as it is defined in the TLS definitions in the ABI.
So, there's no magic involved. :) I can read that value from the
register and get the thread ID from there. I know that this approach
works on ppc32, ppc64 and s390. Don't know about other archs, though.
That's why I'm worried about providing a fix that can be extended to
other archs.

> Now that most platforms have moved from LinuxThreads to NPTL, this
> might be worth another look. Opportunistically, sometimes we can use
> libthread_db and get sensible answers.
This may be a silly question, but, how can we use libthread_db in
order to get the thread ID from threads within a core file?

Regards,

- --
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center Brazil
Phone: +55 19-2132-4339
T/L: 839-4339
E-Mail: cseo@linux.vnet.ibm.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGt5C5qvq7Aov/qQARAuYjAJ4nx36Jm1Ix2Mgmz3KlIsTptvBRlACgjIQT
vjdq9KtChupvNmrtxHloKAQ=
=/E52
-----END PGP SIGNATURE-----