使用 Eclipse 在 Android 上使用 gdb 调试本机代码 (C++)。是否可以?

发布于 2024-09-03 01:55:47 字数 190 浏览 1 评论 0原文

我有一些使用 JNI 的代码。我可以直接在 Eclipse 中调试用 Java 编写的代码(使用 ADT)。我什至有一个脚本,可以帮助我使用 gdb 调试本机代码。然而,这并不是一种很舒服的方式。

是否可以将 Eclipse 配置为使用 gdb(我猜是 gdbserver)来调试 android 本机应用程序?你知道我在哪里可以找到这方面的描述吗?

I have some piece of code which uses JNI. I can debug code wrote in Java directly in Eclipse (using ADT). I even have a script, which help me debug native code with gdb. However this is not very comfortable way for doing this.

Is it possible to configure Eclipse to use gdb (I guess gdbserver) for debbuging android native applications? Do you know where I could find any description of this?

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

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

发布评论

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

评论(2

还给你自由 2024-09-10 01:55:47

根据 Android 2.2 NDK 的发行说明 - 您现在可以在设备本机代码上进行调试。
请参阅 NDK 文档,因为我自己没有尝试过。

according to the release notes from Android 2.2 NDK - you can now debug on device native code.
please refer to the NDK docs, since I didn't try this myself.

哎呦我呸! 2024-09-10 01:55:47

这取决于您是否想要调试使用 NDK api 编写的 JNI 代码与 AOSP 应用程序中的本机代码。

对于前一种情况,请使用NDK调试工具。对于后者,您需要有正确版本的 gdbserver 和 gdb。需要使用 gdb 脚本配置会话以查找 AOSP 库的符号。
请查看调试 AOSP 本机应用程序链接以了解详细信息教程。

It depends whether you want to debug JNI code you have written using NDK apis vs native code in AOSP applications.

For the former case, use NDK debugging tools. For the latter, you need to have right version of gdbserver and gdb. The session needs to be configured with gdb script to find symbols for AOSP libs.
Please check Debugging AOSP native applications link for step by step tutorial.

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