You need to sign gdb that you need to trust in order to control the execution of another process. This is part of the security structures that are present in ElCapitan (as was the case with the Mavericks).
You can do this by following the instructions below (extract from the blog post http://ntraft.com/installing-gdb-on-os-x-mavericks/ , which contains additional information on the topic).
GDB Certification
Open the Keychain Access application (/ Applications / Utilities / Keychain Access.app). Go to the menu under "Keychain Access"> "Certificate Assistant"> "Create Certificate ...

Enter a name for the certificate. For this, I will call it "gdb-cert". Set the fields exactly as shown below.

The maximum validity period is 999 days. I really don't want to deal with this again, so I'm going to maximize it. / * Addendum: this means that you will have to do it again after 999 days, i.e. 2.7 years. You might want to bookmark this page. * /

Keep clicking the Continue button until you are asked to specify a location. Set it to "System". If you cannot save it in the system key, save it in the login login chain. You can later export the certificate and then import it into the system keychain. I did not need to do this, so please comment if you have any problems.

Success!

Now make sure that the certificate is always trusted. Right-click the new certificate and select Get Information. In the "Trust" section, set the "Sign Code Always Trust" option.

Now that we have the certificate, we must use it to sign the GDB. First, we will restart the process with the given tasks to make sure that it takes a new certificate. Exit Keychain Access (you must exit Keychain Access!) And return to the terminal for these final commands.
Find the given process.
$ ps -e | grep taskgated 56822 ?? 0:03.11 /usr/libexec/taskgated -s 60944 ttys002 0:00.00 grep --color=auto taskgated
The first number in the above output is the PID. Use this to kill a process (it will restart immediately).
$ sudo kill -9 56822
Now you can finally sign the GDB mark.
# If installed through MacPorts $ codesign -s gdb-cert $(which gdb-apple)
You should now be tuned! OS Keychain may ask for a password the first time you try to debug a program, but it should work!
/ * Application: in order to be able to have full functionality, I had to restart the computer. * /