使gdb在“全部应用”操作上显示线程名称

使gdb在“全部应用”操作上显示线程名称,gdb,pthreads,pretty-print,Gdb,Pthreads,Pretty Print,我正在调试一个有很多线程的应用程序,所以我用prctl命名了它们。这在gdb的info threads选项中非常有效,但如果thread*apply all操作也显示了这一点,那就更好了。有没有办法强迫gdb这么做 (gdb) info threads Id Target Id Frame ... 3 Thread 0x7ffff6ffe700 (LWP 30048) "poll_uart_threa" 0x00007ffff78eb823 in sele

我正在调试一个有很多线程的应用程序,所以我用prctl命名了它们。这在gdb的info threads选项中非常有效,但如果thread*apply all操作也显示了这一点,那就更好了。有没有办法强迫gdb这么做

(gdb) info threads
  Id   Target Id         Frame 
  ...
  3    Thread 0x7ffff6ffe700 (LWP 30048) "poll_uart_threa" 0x00007ffff78eb823 in select ()
    at ../sysdeps/unix/syscall-template.S:82
  2    Thread 0x7ffff77ff700 (LWP 30047) "signal hander" do_sigwait (set=<optimized out>, 
    sig=0x7ffff77feed8)
    at ../nptl/sysdeps/unix/sysv/linux/../../../../../sysdeps/unix/sysv/linux/sigwait.c:65
* 1    Thread 0x7ffff7fcc700 (LWP 30046) "simulator" __lll_lock_wait ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132
指针、PID{well、线程ID,但LWP threads==进程、ish}和名称

(gdb) thread apply all bt
...
Thread 3 (Thread 0x7ffff6ffe700 (LWP 30048)):
#0  0x00007ffff78eb823 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x0000000000403bb3 in poll_uart_thread (unused=0x0) at uart.c:96
#2  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff6ffe700) at pthread_create.c:308
#3  0x00007ffff78f24bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7ffff77ff700 (LWP 30047)):
<call stack>
#2  0x0000000000417a89 in sig_thread (arg=0x7fffffffbb60) at simulator.c:879
#3  0x00007ffff7bc4e9a in start_thread (arg=0x7ffff77ff700) at pthread_create.c:308
#4  0x00007ffff78f24bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fcc700 (LWP 30046)):
<call stack>
#9  0x00000000004182e3 in simulator (flash_file=0x7fffffffe0e4 "../programs/blink.bin")
    at simulator.c:1005
#10 0x0000000000401f14 in main (argc=3, argv=0x7fffffffdd48) at cli.c:167
虽然我可以通过查找调用堆栈来找到名称,但是如果它可以打印在摘要行中,这将非常好/方便/etc,这里只有PID和指针

如果它能在摘要行中打印,那就太好了,这里只有PID和指针

请在中提交电子财务请求

如果您将GDB与嵌入式python一起使用,您可能可以通过线程应用程序来完成您想要的任务,但它确实应该已经完成了正确的任务

如果它能在摘要行中打印,那就太好了,这里只有PID和指针

请在中提交电子财务请求


如果您将GDB与嵌入式python一起使用,您可能可以通过线程应用程序来执行您想要的操作,但它确实应该已经做了正确的事情。

如果相关,我正在运行:GNU GDB Ubuntu/Linaro 7.4-2012.04-0ubuntu2 7.4-2012.04如果相关,我正在运行:GNU GDB Ubuntu/Linaro 7.4-2012.04-0ubuntu2 7.4-2012.04