在Android Studio中外部剥离的共享库的本机调试 [英] Native debugging of external stripped shared library in Android Studio

查看:139
本文介绍了在Android Studio中外部剥离的共享库的本机调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经剥离和未分配的共享库。
如何在Android Studio中使用LLDB调试时加载符号?



我可以成功调试位于jniLibs文件夹中的完整的unsripped .so。
但是它太大了,部署时间太长。



在Debug配置中指定符号目录不适用于standart和experemental插件。 p>

解决方案

您需要使用--build-id标记链接库,因此Android Studio中的LLDB可以找到它而不是拉它从设备。如果使用NDK工具链,只需将以下内容添加到链接器标记中:

 ' -  Wl, -  build-id'

您可能还需要告诉Android Studio在哪里查找未分类的图书馆(如果您自己删除图书馆)。您可以通过运行 - >编辑配置 - >调试器选项卡 - >符号目录并添加路径来执行此操作。



要检查哪个库是LLDB,可以暂停您的应用程序然后转到Native Debugger选项卡 - > LLDB控制台,然后键入:

 图像列表

如果您使用ndk-build,只需将标记添加到Android.mk中的LOCAL_LDFLAGS或使用NDK r12b或更高版本默认情况下启用)。


I have stripped and unstripped shared library. How to load symbols while debugging stripped in Android Studio with LLDB?

I can successfully debug full unstripped .so located in "jniLibs" folder. But it is too big, and deploying takes too long.

Specifying of symbols directory in Debug configuration doesn't work with standart and experemental plugin.

解决方案

You need to link your libraries with the "--build-id" flag so LLDB in Android Studio can find it instead of pulling it from the device. If your using the NDK toolchain just add the following to your linker flags:

'-Wl,--build-id'

You may also need to tell Android Studio where to look for the unstripped libraries (if you stripped the libraries yourself). You can do this by going to Run->Edit Configurations->Debugger Tab->Symbols Directories and add your path.

To check which library is LLDB using you can pause your app then go to the Native Debugger tab -> LLDB console and type:

image list

If your using ndk-build, just add the flag to the LOCAL_LDFLAGS in the Android.mk or just use NDK r12b or higher (the flag is enabled by default).

这篇关于在Android Studio中外部剥离的共享库的本机调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆