Whenever I try to debug any program (i.e. a welcome message), I get this prompt. Any ideas how to run the debugger for C++ program?
-
Since you've tagged this with [tag:gdb], have you actually tried entering `/usr/bin/gdb` or the like into the "Debugger Command" field? – Ken Y-N Feb 19 '16 at 04:53
-
@KenY-N I did, but nothing changed. I still can't press ok, and the `/usr/bin/gdb` was highlighted in red! – Lieft1951 Feb 19 '16 at 05:00
5 Answers
For Mac OSX 10.5 and above,
Install Homebrew (if you don't have it already)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install GDB
brew install gdb
Go to https://sourceware.org/gdb/wiki/BuildingOnDarwin and follow the instructions to code sign the gdb binary.
If you're on Sierra, run the following command in your terminal
echo "set startup-with-shell off" >> ~/.gdbinit
Finally, run the following comamnd in your terminal
which gdb
- Copy the output path from that command, (mine was /usr/local/bin/gdb) into the Debugger Command box in Netbeans and start debugging!

- 6,413
- 3
- 30
- 31
On Linux systems derived from debian, you have to install gdb
sudo apt-get install gdb
Then in debbuger command type
/usr/bin/gdb
More information of gdb can be found in GDB: The GNU Project Debugger

- 21
- 1
- 4
Make sure gdb is installed in your machine. you can do this by following C:\cygwin64>setup-x86_64.exe -q -P gdb
after this, select gdb as a debugger in netbeans gdb location

- 11
- 1
On a Mac, I installed HomeBrew first, then followed this exactly on the Sierra OS. Worked perfectly. After Homebrew is installed, you have to create then sign your gdb certificate. Then select it in your IDE debugger section.
The instructions show how to select gdb in Eclipse, but I got it working in NetBeans by pushing the debugger button and typing in the file path in the popup (as mentioned in this document).
https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html

- 3,066
- 3
- 45
- 73