Software Archive
Read-only legacy content
17061 Discussions

Debugging in native mode: gdb complains about libthread_db

John_F_1
Beginner
2,829 Views

When I try to debug a program in native mode directly on the card using gdb, I get the following message:

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

As it indicates, I am unable to navigate threads. I am ssh'ing to the card directly and running the gdb built for MPSS 3.2.1. ldd on the executable shows that I am using libpthread from /lib64:

libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f30c7f77000)

And there is indeed a libthread_db in /lib64:

lrwxrwxrwx    1 root     root            19 Jan  1  1970 /lib64/libthread_db.so.1 -> libthread_db-1.0.so
-rwxr-xr-x    1 root     root         31384 Apr  2 15:49 /lib64/libthread_db-1.0.so

Is there something else that I need to do? One detail that may be relevant is that I built using the cross compiler that comes with the windows installation of composer.

0 Kudos
3 Replies
John_F_1
Beginner
2,829 Views

I figured it out: you need to install libc6-dbg as well, which provides the following files:

-rwxr-xr-x    1 root     root        212261 Apr  2 15:48 /lib64/.debug/libthread_db-1.0.so
-rwxr-xr-x    1 root     root        679207 Apr  2 15:49 /lib64/.debug/libpthread-2.14.90.so
lrwxrwxrwx    1 root     root            19 May 29 13:53 /lib64/.debug/libthread_db.so.1 -> libthread_db-1.0.so
lrwxrwxrwx    1 root     root            21 May 29 13:53 /lib64/.debug/libpthread.so.0 -> libpthread-2.14.90.so

 

0 Kudos
Kevin_D_Intel
Employee
2,829 Views

From an earlier case of this on Linux, it was advised that point 4 from the following Errata (https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Errata) was necessary which has one transferring those to the coprocessor.

Have you also done that?
 

0 Kudos
John_F_1
Beginner
2,829 Views

Actually, no, I didn't do that. In fact, debugging the main thread still worked when I had only installed gdb on the coprocessor.

0 Kudos
Reply