Use either gdb or the path where gdb was installed (for example, /usr/local/Cellar/gdb/7.10/bin/gdb) in the menu /Netbeans/Preferences/C/C++/Build Tools field Debugger Command field.In my case: $ codesign -s gdb-cert /usr/local/Cellar/gdb/7.10/bin/gdb If the certificate is known as gdb-cert, just use: $ codesign -s gdb-cert gdbĬomment: if gdb is not found, then add the path where it was installed. (As usual, it may ask for your password.) Now, we need to code-sign the GDB executable, so it will be allowed to control other processes, as necessary for a debugger.
In a Terminal window, run the command brew install gdb, and wait for it to complete. Giving gdb permission to control other processes As with GCC, the easiest way to install GDB is through Homebrew. You must quit Keychain Access application in order to use the certificate and restart taskgated service by killing the current running taskgated process (comment: for example with sudo pkill taskgated or restarting).
#HOW TO INSTALL GDB ON MAC CODE#
You can then imported it into the System keychain.įinally, using the contextual menu for the certificate, select Get Info, open the Trust item, and set Code Signing to Always Trust. If you can't store the certificate in the System keychain, create it in the login keychain, then exported it. Click several times on Continue until you get to the Specify a Location For The Certificate screen, then set Keychain to System. Open menu /Keychain Access/Certificate Assistant/Create a Certificate.Ĭhoose a name ( gdb-cert in the example), set Identity Type to Self Signed Root, set Certificate Type to Code Signing and select the Let me override defaults. Start Keychain Access application ( /Applications/Utilities/Keychain Access.app) make and wait again (which can take some time) sudo make install. then follow the instructions in the README file in the gdb folder, or simply follow the following steps./configure, wait for the terminal. cd gdb-7.12.1 in terminal to open the gdb folder. Codesign the binary following these instructions: I copy them here for the sake of completeness and to add some comments: expand the gdb-7.12.1.tar.xz file: tar xopf gdb-7.12.1.tar.xz.$ brew search | grep gdb # cgdb gdb gdbm pgdbf
cd gdb-7.12.1 in terminal to open the gdb folder then follow the instructions in the README. brew install gdb, (As usual, it may ask for your password.) Now, we need to code-sign the GDB executable, so it will be allowed to For that, we will first create a new certificate in Keychain. 4 Answers 4 expand the gdb-7.12.1.tar.xz file: tar xopf gdb-7.12. This step turned out to be decisive for me as, before updating, brew did not find any gdb package: $ brew install gdb # Error: No available formula for gdb As with GCC, the easiest way to install GDB is through Homebrew. If you already have installed brew, check for updates. That's what I did to install GDB (under Yosemite):