LLDB:添加符号文件?

LLDB:添加符号文件?

问题描述:

我试图从调试的Andr​​oid Studio的本机调试使用LLDB一个Android原生应用。结果
我的本机应用程序包含一个libmain.so被编译并通过Android的工作室和我编译另一个外部libother.so运行。调试时,我能够设置断点libmain.so但不libother.so。结果
这两个共享对象被剥离,但不知何故的Andr​​oid Studio可以LLDB了解libmain.so的未剥离的版本。我想为libother.so这样做。

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 Studio and another external libother.so compiled by me. when debugging, I am able to set breakpoints in libmain.so but not libother.so.
Both shared objects are stripped but somehow Android Studio makes lldb know about the unstripped version of libmain.so. I want to do the same for libother.so.

什么命令,我需要给LLDB,这样它会从我的本地机器上的一个剥开文件加载的符号?结果
当我做图片列表我看到主要的。所以一个路径指向本地剥开版本:

What command do I need to give lldb so that it would load the symbols from an unstripped file on my local machine?
When I do image list I see the main .so with a path the points to its local unstripped version:

/Users/username/Projects/gow/android/AppName/app/build/intermediates/binaries/debug/arm7/obj/armeabi-v7a/libmain.so$c$c>

和像路径第二的.so
       /var/folders/3w/5nr95lxx3qvdm2ylb8c8b7500000gn/T/./lldb/module_cache/remote-android/.cache/B5F32653-0000-0000-0000-000000000000/libother.so$c$c>

如何使LLDB找到 libother.so ?结果的剥开版本
我试图图像添加目标符号添加,但没有奏效。

How do I make lldb find the unstripped version of libother.so ?
I tried image add and target symbols add but it didn't work.

有关完整性,我最终做的是结果
- 建立-ID = SHA1 在libmain.so的Andr​​oid.mk到 LOCAL_LDFLAGS - 轮候册,加结果
- 从添加一个符号链接/Users/username/Projects/gow/android/AppName/app/build/intermediates/binaries/debug/arm7/obj/armeabi-v7a/$c$c>到剥开共享对象。

For completeness, what I ended up doing is
- add -Wl,--build-id=sha1 to the LOCAL_LDFLAGS in the Android.mk of libmain.so
- add a symlink from /Users/username/Projects/gow/android/AppName/app/build/intermediates/binaries/debug/arm7/obj/armeabi-v7a/ to the unstripped shared object.

这使得Android的Studio的LLDB找到剥开。所以,正确的present它的符号,让我在libmain.so code添加断点。

That allowed Android-Studio's LLDB to find the unstripped .so, correctly present its symbols and allowed me to add breakpoints in libmain.so code.