Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Debugging prebuilt native libraries with lldb

How can I get lldb to see a prebuilt native library's symbols when using the latest Android Studio tools?

I'm working on an Android app using Android Studio 2.2.2. My app has a native component and also depends on a prebuilt native library that my native component links to. When I break into some native code with the debugger, the debugger has symbols for my native code but not for the prebuilt library, which I built with symbols. The documentation that I've found on debugging prebuilt native libraries (https://developer.android.com/ndk/guides/prebuilts.html#dp) appears to be outdated, as it refers to Android.mk and ndk-gdb, as opposed to build.gradle, CMakeLists.txt, and lldb, which are what I'm using.

Here's a bit more info for anyone who's familiar with lldb (which is not to say that I am familiar with it). I think it reflects the fact that the debugger is looking at the non-symbol-stripped version of my native code, in libnative-lib.so, which is stored on my machine, but is looking at the symbol-stripped version of the prebuilt library, libaws-cpp-sdk-vitalservices.so, which is stored on the android device:

(lldb) image list
...
[107] B8FC838B-0000-0000-0000-000000000000            /Users/christophersimmons/.lldb/module_cache/remote-android/.cache/B8FC838B-0000-0000-0000-000000000000/libaws-cpp-sdk-vitalservices.so 
[108] A7AD2397-02E5-5AE9-0192-F2353B51C362-C40832C9            /Users/christophersimmons/Documents/repos/DoclilyAndroid/app/build/intermediates/cmake/debug/obj/x86/libnative-lib.so 
like image 545
Christopher Simmons Avatar asked Dec 01 '16 02:12

Christopher Simmons


People also ask

What is LLDB Android?

LLDB is a native debugger; nothing to worry about unless you use the NDK . Current AMD CPU work fine, while using KVM or WHPX for the virtualization. Follow this answer to receive notifications.


1 Answers

How large is your executable ?

It seems that the lldb client for Android Studio is a 32b application so it cannot handle large so files!

https://issuetracker.google.com/issues/37324018

It seems it will be fixed soon !

like image 102
Mihai Sebea Avatar answered Oct 13 '22 00:10

Mihai Sebea