Accessing pthread_key_create thread-specific data

Tom Tromey tom@tromey.com
Fri Mar 12 15:54:52 GMT 2021


>>>>> "Florian" == Florian Weimer via Gdb <gdb@sourceware.org> writes:

Florian> We have some functionality in libthread_db in glibc that provides access
Florian> to pthread_key_create thread-specific data (aka pthread_setspecific and
Florian> pthread_getspecific).  I would like to write a GDB test for this
Florian> functionality, but I can't find how GDB exposes this data in the UI.  Is
Florian> this just dead code?

As far as I know, these aren't used and I think have never been used.

I'm not sure how I would go about exposing this to users.  The most
natural way might be to intercept calls to pthread_*specific.  Maybe a
couple of new convenience functions would be good though, and less
magical.

I guess this would primarily be useful for core file debugging?
Assuming inferior calls to pthread_*specific already work -- I haven't
tried.

thanks,
Tom


More information about the Gdb mailing list