Skip to content
Advertisement

gdb how to get thread name displayed

There are many threads created in my application. some of the threads name are visible in the gdb while i execute the command ‘info threads’, others are not displayed. How to get all the thread name itself instead of the hex value like 0xb7fe1424

4 Thread 0xb68ffb70 (LWP 18377)  0xb7fe1424 in __kernel_vsyscall ()
* 3 Thread 0xb7291b70 (LWP 18375)  JKMainT (arg=0x0) at mylib.cpp:482
2 Thread 0xb7a92b70 (LWP 18374)  0xb7fe1424 in __kernel_vsyscall ()
1 Thread 0xb7a94730 (LWP 18371)  0xb7fe1424 in __kernel_vsyscall ()

Advertisement

Answer

If you upgrade to gdb 7.3 or later, “info thread” will show thread names; at least on native (not remote) Linux.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement