GDB does not see any threads besides the one in which crash occurred; or SIGTRAP kills my program when I set a breakpoint.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This frequently happen on Linux, especially on embedded targets. There are two common causes:
libpthread.so.0libpthread.so.0andlibthread_db.so.1GDB 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.1andlibpthread.so.0must match in version and compilation flags. In addition,libthread_db.so.1requires certain non-global symbols to be present inlibpthread.so.0.Solution: use
strip --strip-debug libpthread.so.0instead ofstrip libpthread.so.0.If you are doing remote debugging, make sure
libpthread.so.0on target andlibthread_db.so.1on host match.