I\'m trying to debug an android native app from Android Studio\'s native debugging using lldb.
My native app contains one libmain.so that is compiled and run by Android
The answers in this thread seem to be specific for MacOSX. I am using Linux, so these answers weren't very helpful. After some time I've figured it out, and here is a very simple solution. Before you do "process attach" you should execute the following command:
settings set target.exec-search-paths /path/to/directory/with/unstripped/library/on/host
With this setting lldb has no problems finding the correct version of the library.
BTW, latest versions of Android Studio don't have any problems with external libraries (in fact, the same technique is used to set correct paths all libraries, both "internal" and "external", at least if you're building with Gradle). But if you use standalone lldb, this can be very handy.
To avoid typing it after start of each debugging session you can save this command to file (e.g. lldb.cmd
) and then start lldb like this:
./lldb -S lldb.cmd