Mac C ++ / Mars eclipse gdb debug freezes when running test 96%

When I try to debug a simple C ++ program in Eclipse Mars (4.5.2) on Mac El Capitan (10.11.5), it hangs on the "Launch Test (96%)".

I have gdb installed with homebrew. When I type "what gdb" in the terminal, it says: "/ usr / local / bin / gdb".

Here are screenshots of the problem and my GDB settings: http://imgur.com/a/JrMjN

This is the same problem that running Mac C ++ / Mars eclipse gdb debugging got stuck at 96% , but it wasn’t solved there.

+2
c ++ debugging eclipse macos
source share
1 answer

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 ...

Create certificate menu menu description

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

Create Certificate Step 1

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. * /

Create Certificate Step 2

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.

Create Certificate Step 3

Success!

Create Certificate Step 4

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.

Get a certificate Always trust code signatures

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) # If installed through Homebrew $ codesign -s gdb-cert $(which gdb) # For the settings posted by OP $ codesign -s gdb-cert /usr/local/Cellar/gdb/7.11/bin/gdb 

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. * /

+5
source share

All Articles