gdb show thread names
Philippe Waroquiers
philippe.waroquiers@skynet.be
Mon Jun 15 16:21:02 GMT 2020
On Mon, 2020-06-15 at 16:51 +0100, Pedro Alves wrote:
>
> Starting program: /home/pedro/brno/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.threads/names/names
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> [New Thread 0x7ffff74b8700 (LWP 24171) "main"]
> [New Thread 0x7ffff6cb7700 (LWP 24172) "main"]
> [New Thread 0x7ffff64b6700 (LWP 24173) "main"]
>
> Thread 1 "main" hit Breakpoint 1, all_threads_ready () at /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.threads/names.c:51
> 51 }
> (gdb) info threads
> Id Target Id Frame
> * 1 Thread 0x7ffff7fb5740 (LWP 24170) "main" all_threads_ready () at /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.threads/names.c:51
> 2 Thread 0x7ffff74b8700 (LWP 24171) "carrot" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61
> 3 Thread 0x7ffff6cb7700 (LWP 24172) "potato" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61
> 4 Thread 0x7ffff64b6700 (LWP 24173) "celery" 0x00007ffff7bc89aa in futex_wait (private=0, expected=4, futex_word=0x7fffffffd604) at ../sysdeps/unix/sysv/linux/futex-internal.h:61
> (gdb)
>
> I.e., printing the thread name when the thread is created
> looks more confusing than helpful to me.
Yes, that is confusing.
And for the following events, when I tried, the patch was far to be ready
e.g. for the exit events, it gives (for the above):
(gdb) c
Continuing.
[Thread 0x7ffff743d700 (LWP 22783) exited]
[Thread 0x7ffff7c3e700 (LWP 22782) exited]
[Thread 0x7ffff7c3f740 (LWP 22778) "main" exited]
So, unclear why there is no carrot, potato or celery in the 2 exited threads
but "main" is present.
(and sometimes there is no names in any exited event).
So, when I looked at it, it needed quite some more work ...
Philippe
More information about the Gdb
mailing list