I have a host machine running 64-bit Linux in x86, and a target board running 32-bit Linux in ARM. I am using gdb-multiarch on the host machine to debug core dump files generated from a multi-threaded binary running on the target board. The debugging seems to work (at least the basic things such as bt, info threads, etc).
However, I see warnings related to libthread_db on startup. I learned that you can use set debug libthread-db 1 to get some extra debug message, and this is what I observed:
- First, I see the
libthread_dbfrom the host machine is being loaded. This fails due to a version mismatch but that seems completely reasonable in my opinion. After all, why would thelibpthreadfrom my target board be compatible with thelibthread_dbon my host machine?
Trying host libthread_db library: libthread_db.so.1.
Host libthread_db.so.1 resolved to: /lib/x86_64-linux-gnu/libthread_db.so.1.
td_ta_new failed: versions of libpthread and libthread_db do not match
- Then, I see the
libthread_dbfrom the target board is being loaded (I have the ARM shared libraries on my host machine). It appears that it failed becausedlopenis expecting a 64-bit shared library, but this doesn't make sense to me because the core dump is generated from a 32-bit binary.
Trying host libthread_db library: <snipped path>/lib/libthread_db.so.1.
dlopen failed: <snipped path>/lib/libthread_db.so.1: wrong ELF class: ELFCLASS32.
thread_db_load_search returning 0
- Finally,
gdb-multiarchcomplains that thread debugging isn't available.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
What am I doing wrong that's preventing libthread_db from being loaded properly?