Comment 1 for bug 926472

Revision history for this message
Thiago Jung Bauermann (thiago-bauermann) wrote :

Hello,

Sorry for taking this long to respond. It took me this long to wrap my head around Android and its version of GDB.

I tried to reproduce your native build of GDB but couldn't. From what I understand, you built a dynamically linked GDB using Linaro's toolchain and the arm-linux-gnueabi target. That produces a binary which is linked against glibc, which won't work on Android.

I was able to create a statically linked GDB though, but that's not very useful in this case because, like gcc warns, "Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking". Since Android doesn't even use glibc it can never work.

What I was able to do was build a dinamically linked gdbserver version 7.3 using Android's toolchain from the NDK and the arm-linux-androideabi target and modified to look for libthread_db.so instead of libthread_db.so.1 (just like you did). That worked when using GDB 7.3 on the host (you have to set solib-search-path to a copy of the device's /system/lib on the host) . It shows all threads using /system/lib/libthread_db.so.

Perhaps that is a suitable workaround for you at this moment.

I'm investigating adding Android support for Linaro GDB, and will also look into why Google ships a gdbserver statically linked with libthread_db if they have a working (at least on the surface) dynamic library.