Mac OS X 10.10.2 does not come with gdb
pre installed. It is available on homebrew:
The binary is installed on /usr/local/bin
When initializing gdb
on a program (a.out
) it will produce the following error:
This error occurs because OSX implements a pid access policy which requires a digital signature for binaries to access other processes pids. To enable gdb
access to other processes, we must first code sign the binary. This signature depends on a particular certificate, which the user must create and register with the system.
How To Install Gdb
To create a code signing certificate, open the Keychain Access application. Choose menu Keychain Access -> Certificate Assistant -> Create a Certificate...
Brew Install Gdb
GDB Installation on Mac OS X. If you work on a Mac OS X 10.9 Mavericks or later, you will run into the problem of Eclipse refusing to interactively debug problems that otherwise build and run fine: An attempt to start a debugging session by selecting Run. Hi guys, I tried to install gdb on my OS X Lion (10.7), but I couldn't. I downloaded gdb and when I try to run configure, it doesn't work, it appears: new-host:gdb-7.4 lorota$./configure checking build system type. I386-apple-darwin11.3.0 checking host system type. Build on Mac OS X 2.1. Install cross compiler gcc and binutils; install qemu; install gdb. You need download the gdb source and compile it to use gdb because port doesn't provide i386-elf-gdb, or you can use the pre-compiled gdb in the tools directory.
Choose a name for the certificate (e.g., gdb-cert
), set Identity Type to Self Signed Root, set Certificate Type to Code Signing and select the Let me override defaults. Click several times on Continue until you get to the Specify a Location For The Certificate screen, then set Keychain to System.
How To Use Gnu Debugger
Double click on the certificate, open Trust section, and set Code Signing to Always Trust. Exit Keychain Access application.
Mac Os X Installer Download
Restart the taskgated service, and sign the binary.