Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
To: gdb@sourceware.org
Subject: GDB doesn't display thread_id while debugging a core file
Date: Mon, 06 Aug 2007 20:27:00 -0000	[thread overview]
Message-ID: <46B78405.9000706@linux.vnet.ibm.com> (raw)

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

Hello

While debugging a core file from a multi-threaded application, I noticed
that GDB doesn't show the thread_id:

(gdb) thread
[Current thread is 4 (process 8466)]

instead of something like this:

(gdb) thread
[Current thread is 5 (Thread 2199033284976 (LWP 4124))]

As far as I'm aware of, this big number is actually the thread pointer
minus an offset value.

For ppc64, I can get the thread pointer from register r13 (which is in
the core file) and then subtract (TLS_PRE_TCB_SIZE + 0x7000) to get the
thread_id. 0x7000 is fixed per the ABI and TLS_PRE_TCB_SIZE can be
calculated from the size of two structs defined in GLIBC (so, I must
assume that the user has a GLIBC with debug information in order to get
the size of those structs).

I know this is an issue that has a solution which is arch-dependent, so
my concern here is to make a fix that's easily extensible to other archs.

Is a solution like this acceptable?

Thanks and regards,

- --
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center
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

iD8DBQFGt4QFqvq7Aov/qQARAt12AJ9szUdI05rLYuJ+r+oiCwPKZjI+BwCfaHpz
YUp9BcgLXvfsoWJ7Id9DDBk=
=ayr3
-----END PGP SIGNATURE-----


             reply	other threads:[~2007-08-06 20:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 20:27 Carlos Eduardo Seo [this message]
2007-08-06 20:33 ` Daniel Jacobowitz
2007-08-06 21:21   ` Carlos Eduardo Seo
2007-08-07 11:31     ` Daniel Jacobowitz
2007-08-08 19:13 msnyder
2007-08-08 19:21 ` Daniel Jacobowitz
2008-04-15  3:05 Icarus Sparry
2008-04-15  3:10 ` Michael Snyder
2008-04-15  6:54   ` Icarus Sparry
2008-04-15  8:12     ` Daniel Jacobowitz
2008-04-15 18:17       ` Michael Snyder
2008-04-15 20:46         ` Icarus Sparry
2008-04-15 23:48           ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46B78405.9000706@linux.vnet.ibm.com \
    --to=cseo@linux.vnet.ibm.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox