开发者

GDB does not see any threads besides

开发者 https://www.devze.com 2023-01-09 11:17 出处:网络
GDB does not see any threads besides the one in which crash occurred; or SIGTRAP kills my program when 开发者_高级运维I set a breakpoint.This frequently happen on Linux, especially on embedded targets

GDB does not see any threads besides the one in which crash occurred; or SIGTRAP kills my program when 开发者_高级运维I set a breakpoint.


This frequently happen on Linux, especially on embedded targets. There are two common causes:

  • you are using glibc, and you have stripped libpthread.so.0
  • mismatch between libpthread.so.0 and libthread_db.so.1

GDB itself does not know how to decode "thread control blocks" maintained by glibc and considered to be glibc private implementation detail. It uses libthread_db.so.1 (part of glibc) to help it do so. Therefore, libthread_db.so.1 and libpthread.so.0 must match in version and compilation flags. In addition, libthread_db.so.1 requires certain non-global symbols to be present in libpthread.so.0.

Solution: use strip --strip-debug libpthread.so.0 instead of strip libpthread.so.0.

If you are doing remote debugging, make sure libpthread.so.0 on target and libthread_db.so.1 on host match.

0

精彩评论

暂无评论...
验证码 换一张
取 消