Android Studio NDK“来自 C 的你好”项目无法调试(无法设置断点)?

发布于 2025-01-12 03:54:51 字数 954 浏览 4 评论 0原文

Android Studio是BumbleBee 2021.1.1 Path 2,刚刚新建了一个Native C++项目,Build菜单|编辑Build Types,点击debug,jni Debuggable选择“true”,运行|编辑配置,调试器选项卡,选择“Native only”,在native-lib.cpp中,设置断点,然后运行|调试应用程序,断点不会被命中!

我在两台电脑上测试过,遇到同样的问题。还有什么需要做的吗?

编辑: 如果在 debugger 选项卡中选择“Dual”,Kotlin 中的断点是可以的,参见图 4。但是 native-lib.cpp 中的断点仍然没有命中。kotlin 中的断点lldb 服务器已启动

编辑构建类型

编辑配置

断点不会被命中

Android Studio is BumbleBee 2021.1.1 Path 2, just new a Native C++ project, the Build menu | Edit Build Types, click debug, jni Debuggable selects "true", the Run | Edit configuration, Debugger tab, selects "Native only", in native-lib.cpp, set a breakpoint, then Run | Debug app, the breakpoint will not be hit!

I have tested these in two computers, meet the same problem. Is there anything more need to do?

Edit:
If selects "Dual" in debugger tab, The breakpoint in Kotlin is OK, see pic 4. but the breakpoint in native-lib.cpp still does not be hit.breakpoint in kotlin
lldb server started

Edit build Types

Edit configuration

The breakpoint will not be hit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

遇到 2025-01-19 03:54:51

更新 android studio 以预览版本 Dolphin (2021.3.1) Canary 7

Update android studio to preview release Dolphin (2021.3.1) Canary 7

等你爱我 2025-01-19 03:54:51

项目(“我的应用程序”)

您可以尝试将 project("myapplication") 添加到 cmakelist 并将 gradle 升级到 7.1.2。

project("myapplication")

You can try to add project("myapplication") to cmakelist and upgrade gradle to 7.1.2.

与风相奔跑 2025-01-19 03:54:51

我在 Electric Eel 2022.1.1 中遇到了同样的问题,唯一有帮助的是进入 jni 函数,然后在调试器视图中的 LLDB 命令行上设置断点,例如:

breakpoint set --file foo.cpp --line 10

有趣的是,之后我可以在该行的编辑器也是如此。

I have the same issue in Electric Eel 2022.1.1 and the only thing that helps is to step in the jni function and then set the breakpoint on the LLDB command line in the debugger view like:

breakpoint set --file foo.cpp --line 10

Interestingly enough, afterwards I can set the breakpoint in the editor for that line as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文