public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Paul Smith <paul@mad-scientist.net>
To: gdb@sourceware.org
Subject: GDB: retrieving pthread local values from a core?
Date: Thu, 15 Nov 2018 20:16:00 -0000	[thread overview]
Message-ID: <7c5e7d4f92a3e6826b58e6068b2872650b27f75b.camel@mad-scientist.net> (raw)

Hi all;

Does anyone have any macros or GDB Python scripting that will allow me
to retrieve the value of a pthread TLS key for the current thread?  I
have the key number returned from pthread_key_create() and I'd like to
do the equivalent of pthread_getspecific(), from a core file.

I've googled around and found a lot of "if you have this or that you
can do it", but I don't really have this or that.  In the code in
question a function failed and stashed a bunch of details about the
failure in a TLS key, then returned up the stack a ways before dumping
core due to a SEGV.  Now I have the core and I'd really like to see
what that error information is, but I can't find a way to get at it...
since all the action around the TLS value was down-stack it's all gone
now (other than the key itself which is in a global variable).

FWIW, I'm using GCC 8.1 on a fairly modern GNU/Linux 64bit system, with
glibc 2.26 and Linux 4.15.

Thanks!

                 reply	other threads:[~2018-11-15 20:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7c5e7d4f92a3e6826b58e6068b2872650b27f75b.camel@mad-scientist.net \
    --to=paul@mad-scientist.net \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).