gdb show thread names

Philippe Waroquiers
Sat Jun 13 12:47:23 GMT 2020

One year ago, I started a patch to add Ada task names and thread names.
At the end, the patch for Ada task name went in, but for the thread
names, there were still some work to do e.g. it was unclear how to
properly give the thread name in some cases and/or 
have a consistent presentation of the thread name.

The (partial) patch was giving a behaviour so that we e.g. get:
      [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
      [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")]
    instead of:
      [New Thread 0x7ffff701b700 (LWP 13918)]
      [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]


On Sat, 2020-06-13 at 01:16 +0100, Jonny Grant wrote:
> Hello
> Just wondering if gdb could show the thread names as they are created and deleted?
> [Thread 0x7fff695e9700 (LWP 3580240) exited]
> [New Thread 0x7fff98ff9700 (LWP 3580609)]
> $ cat /proc/3580609/comm
> ThreadPoolForeg
> Could be a race condition, if GDB showed the name, before it was renamed by the application, but still pretty useful to see the names.
> If I break, and type "info thread" I can see those still created.
> Jonny

More information about the Gdb mailing list