|
|
系统:slackware-10.0,默认配置,没有升级过GCC, GDB, GLIBC。
GDB无法识别线程,如果在线程中设断点,会导致SIGTRAP,如同将断点设在没有attach的进程上。
xxx@xxx:~/testbase$ gdb mutex
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) handle SIG32 nostop
Signal Stop Print Pass to program Description
SIG32 No Yes Yes Real-time event 32
(gdb) br thread_01
Breakpoint 1 at 0x80485aa: file mutex.c, line 10.
(gdb) r
Starting program: /home/triston/testbase/mutex
Program received signal SIG32, Real-time event 32.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x40397ec0 in pthread_yield () from /lib/libpthread.so.0
(gdb)
在redhat9.0 上线程可以被调试。GDB可以识别新生成的线程,并且设断点也可以正常工作。
:comp |
|