我在Mac OSX Yosemite上使用Eclipse LUNA CDT,我最近在我的机器上设置了GDB 7.9.1来调试我的应用程序。 我注意到调试会话非常糟糕:每条指令没有步进运行,断点没有停止,我无法观察变量内容或可视化内存(堆栈/堆)等... 有没有人使用GDB用于同一目的? 这是Eclipse的限制还是我在开发环境中的某处安装了错误的版本?
感谢您的帮助。
我展示了以下版本的开发环境:
Eclipse版本:Luna Service Release 2(4.4.2)
gcc --version
配置: - prefix = / Applications / Xcode.app / Contents / Developer / usr --with-gxx-include-dir = / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer /SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM版本6.1.0(clang-602.0.49)(基于LLVM 3.6.0svn) 目标:x86_64-apple-darwin14.3.0 线程模型:posix
GNU gdb(GDB)7.9.1 版权所有(C)2015 Free Software Foundation,Inc。 许可证GPLv3 +:GNU GPL版本3或更高版本 此GDB配置为" x86_64-apple-darwin14.3.0"。
答案 0 :(得分:0)
Apple从Yosemite开始逐步取消对GDB 7.9.1的支持,转而支持LLDB。不幸的是,Eclipse CDT不支持LLDB。
尝试安装gdb的mac ports版本和apple-gcc 编译器:
$ sudo port install gdb-apple
$ sudo port install apple-gcc42
为您创建系统证书后,代码签署gdb-apple:
codesign -s gdb-cert $(which gdb-apple)
重新启动任务门控流程。
在eclipse中设置调试器以使用gdb-apple而不是gdb,它 应安装到/ opt / local / bin / gdb-apple
更多细节可以在这里找到 http://ntraft.com/installing-gdb-on-os-x-mavericks/