I'm trying to use GDB with code blocks on Mac OS X Yosemite 10.10.1.
I have installed GDB using homebrew with the instructions described here : http://wiki.lazarus.freepascal.org/GDB_on_OS_X_Mavericks_and_Xcode_5
I have included the path of gdb (/usr/local/bin/gdb) in the Settings -> Debugger ->GDB/CDB Debugger -> Default -> Executable Path
Everything seems to be ok on the configuration end.
But, when I try to debug an application, I get the following error :
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /Users/dullin/Documents/Programs/final_A14/
Adding source dir: /Users/dullin/Documents/Programs/final_A14/
Adding file: /Users/dullin/Documents/Programs/final_A14/bin/Debug/final_A14
Changing directory to: /Users/dullin/Documents/Programs/final_A14/.
Set variable: DYLD_LIBRARY_PATH=.:
Starting debugger: /usr/local/bin/gdb -nx -fullname -quiet -args /Users/dullin/Documents/Programs/final_A14/bin/Debug/final_A14
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Can't launch console (osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script ""' -e 'end tell' sleep 80067587)
Debugger name and version: GNU gdb (GDB) 7.8.1
No stack.
The problem seems to be invoking the Terminal window correctly with gdb attached because of the following error :
Can't launch console (osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script ""' -e 'end tell' sleep 80067587)
When starting to debug, a terminal window opens but no commands are executed from it.
The same command is passed when I normally run my application (which goes fine) with the following command :
Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/dullin/Documents/Programs/final_A14/bin/Debug/final_A14 "' -e 'end tell' (in /Users/dullin/Documents/Programs/final_A14/.)
I have found an old post (http://forums.codeblocks.org/index.php?topic=18068.0) that had the same problems but seems to offer no solutions.
Is it a bug within code blocks or a misconfigured system? Is it normal that the 'do script' has no argument when launching the debugger?