I want to debug pthreads on my custom linux distribution but I am missing something. My host is Ubuntu 12.04, my target is an i486 custom embedded Linux built with a crosstool-N
This:
dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_lgetfpregs
GDB will not be able to debug pthreads.
means that the libthread_db.so.1
library was not able to find the symbol ps_lgetfpregs
in gdb.
Why?
Because I built gdb using Crosstoolg-NG with the "Build a static native gdb" option and this adds the -static
option to gcc.
The native gdb is built with the -rdynamic
option and this populates the .dynsym symbol table in the ELF file with all symbols, even unused ones. libread_db uses this symbol table to find ps_lgetfpregs
from gdb.
But -static
strips the .dynsym
table from the ELF file.
At this point there are two options:
Edit:
By the way, this does not explain why Breakpad in unable to debug multithreaded applications on my target.