I am using Eclipse LUNA CDT on my Mac OSX Yosemite and I recently set up GDB 7.9.1 on my machine to debug my applications. I noticed that the debug session is very poor: no step run per instruction, no stop on break points, I can not watch the variables content or visualise the memory (stack/heap) etc... Does anyone use GDB for the same purpose? Is this a limitation of Eclipse or did I install a wrong version somewhere in my development environment?
Thanks for help.
I show the following versions of my development environment:
Eclipse Version: Luna Service Release 2 (4.4.2)
gcc --version
Configured with: --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 version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
- gdb --version
GNU gdb (GDB) 7.9.1 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This GDB was configured as "x86_64-apple-darwin14.3.0".
Apple phased out support for GDB 7.9.1 in favor of LLDB beginning with Yosemite. Unfortunately Eclipse CDT doesn't support LLDB.
Try installing the mac ports version of gdb and the apple-gcc compiler:
Code sign gdb-apple after you create a system cert for it:
Restart the taskgated process.
Set the debugger in eclipse to use gdb-apple instead of gdb , it should be installed to /opt/local/bin/gdb-apple
More details can be found here http://ntraft.com/installing-gdb-on-os-x-mavericks/