While I know pthread_self() returns an opaque type and we do our best to print that out in verbose messages, it would be good if we could represent it in the same way gdb shows it. On MacOS it is a struct I believe and gdb doesn't try to show anything. And in our verbose messages, what we display is simply enough to distinguish one from another. On Linux it appears to be an address and that is what gdb is showing.
For example, here are 4 thread ids extracted from verbose messages:
0027406a177f0000 0037c06a177f0000 0047406b177f0000 00f7ff63177f0000
And here are the seven threads running that generated the messages, from info threads in gdb:
(gdb) info thread Id Target Id Frame 7 Thread 0x7f176c406700 (LWP 28025) 6 Thread 0x7f176bc05700 (LWP 28026) 5 Thread 0x7f176b404700 (LWP 28027) 4 Thread 0x7f1763fff700 (LWP 28028) 3 Thread 0x7f176ac03700 (LWP 28029) 2 Thread 0x7f176a402700 (LWP 28030) * 1 Thread 0x7f176e87b740 (LWP 28019)
With this small number, if I squint hard, I can sort of tie them together. Does anyone know what gdb uses to know whether or not it can display it? Can we somehow determine if it can be displayed and do some ifdef'ing to display it?