LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1319|回复: 4

求助:线程无法调试

[复制链接]
发表于 2005-11-12 23:22:41 | 显示全部楼层 |阅读模式
系统: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
 楼主| 发表于 2005-11-14 13:49:55 | 显示全部楼层
难道没有人遇到相同的问题吗?郁闷...
回复 支持 反对

使用道具 举报

发表于 2005-11-17 22:03:46 | 显示全部楼层
搜索 以前的贴子
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-21 09:47:47 | 显示全部楼层
还能给个链接?

Post by kj501
搜索 以前的贴子
回复 支持 反对

使用道具 举报

发表于 2005-11-23 01:44:19 | 显示全部楼层
这样吧,你试试在gdb启动时,先输入这两行:
set auto-solib-add 0
handle SIG32 nostop noprint pass
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表