INSTALLATION:
Before you go for installation, check if you already have gdb installed on your Unix system by issuing the following command: $gdb -help. If GDB is installed, then it will display all the available options within your GDB. If GDB is not installed, then proceed for a fresh installation. You can install GDB on your system by following the simple steps discussed below. May 12, 2016 Xcode no longer installs gdb so you need to install it yourself. Keep in mind lldb should be on your system so you may not need gdb after all. If you do however, you can install it using homebrew.
- if not installed already, install
brew
- if you have brew already on your system, you might want to update the brew installation, typing:
brew update
. This will give you the latest installation recipes - install GDB:
brew install gdb
. This will install the latest GDB.
CONFIGURATION:
If you try to start using the newly installed GDB in your terminal at once, you may get an error like this one:
If that’s the case, you should code-sign GDB. In order to do so, please follow the following steps.
CODE-SIGNING GDB:
Clicking on Continue you will get a warning like “You are about to create a self-signed certificate.”, you can continue. You are now asked to set a validity period, in days; I just set 999 days (which appears to be the maximum value accepted, at least on Mavericks) so I don’t have to do it again in a short while. Then, for the purpose of this self-signed certificate made to run GDB on our system, you can skip all the other certificate settings, just clicking on “Continue” when asked, until your are asked to set the location
here, choose “System”, then click on “Create”.You might be asked for your password, and you will get your new certificate!
Now go to the Certificate Assintant window and look for your newly created certificate “gdb-cert”, then double-click on it. You will get the detailed info about the new certificate:
Click on “Trust”, and set the first setting to “Always Trust”
Close the Certificate Assistant window; you might be asked for your password to save the changes you made.
Now we want to kill the taskgated
process, to be sure to pick the new certificate when code-signing:
Now we can code sign our GDB. To do that we open a shell, and we look for the GDB location:
then we can use this location to code-sign GDB, typing:
How To Install Gdb
You might then be asked for your password.
How To Install Gdb For Mac
If you get an error like this
then restarting your machine should fix the problem.
Install Gdb From Source
Now we can use the just installed gdb
in our shell!