ndk-gdb 和 eclipse “没有名为...的源文件”

发布于 2024-12-05 01:53:06 字数 733 浏览 1 评论 0原文

我正在尝试调试一些使用 android ndk-build 脚本构建的本机代码,但遇到了一个小障碍。我已经将本机代码编译到共享库中,我想在 eclipse 中使用 ndk-gdb 对其进行调试。该代码是使用

APP_OPTIM := debug

Application.mk 文件构建的,为了确定起见,我还添加了 -g 标志。

Eclipse 配置为调试本机代码,我可以连接到设备上的 gdbserver,但由于 gdb 出现以下错误,我无法设置断点:

496-break-insert /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp:17
No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.
&"No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.\n"
496^done
(gdb) 
499-exec-continue
499^running
(gdb) 

在显示的位置确实有一个名为 SDL_android_main.cpp 的文件,但这是我收到错误,此时它不会到达断点。

任何想法或建议将不胜感激。

-克拉克-

I'm trying to debug some native code I built using the android ndk-build script and have hit a small hurdle. I've compiled the native code into a shared library and I want to debug it using ndk-gdb in eclipse. The code is built using

APP_OPTIM := debug

in the Application.mk file and I've also added the -g flag just to be sure.

Eclipse is configured to debug the native code and I can connect to the gdbserver on the device but I am unable to set breakpoints due to the following error from gdb:

496-break-insert /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp:17
No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.
&"No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.\n"
496^done
(gdb) 
499-exec-continue
499^running
(gdb) 

There is indeed a file named SDL_android_main.cpp at the location shown but this is the error I am getting and it will not hit the breakpoint at this time.

Any ideas or suggestions would be greatly appreciated.

-clark-

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

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

发布评论

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

评论(1

隐诗 2024-12-12 01:53:06

该错误并不意味着 GDB 无法看到 /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp。相反,这意味着 GDB 无法在当前加载的可执行文件和共享库中看到该源的调试信息。

可能是您的共享库尚未加载。

或者 GDB 可能知道该文件,但使用其他名称。尝试信息源break SDL_android_main.cpp:17

The error doesn't mean that GDB can't see /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp. Rather, it means that GDB can't see debug info for that source in the executable and shared libraries currently loaded.

It may be that your shared library is not loaded yet.

Or it could be that the file is known to GDB, but under some other name. Try info sources or break SDL_android_main.cpp:17

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