ndk-gdb 和 eclipse “没有名为...的源文件”
我正在尝试调试一些使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误并不意味着 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
orbreak SDL_android_main.cpp:17