Debugging the C program in Eclipse, it appears: "Error while launching Command:gdb-version". You need to let eclipse know exactly where Eclipse is configured by: "Debug config"--"Debugger"--"gdb" in gdb Debugger changed to GDB's absolute path: "/ Usr/local/bin/gdb "
However, there will still be errors after configuration:
Unable to find Mach task port for Process-id 83686: (os/kern) Failure (0x5). (Please check that GDB is Codesigned-see taskgated (8)) Unable to find Mach task port for Process-id 83686: (os/kern) Failure (0x5). (Please check that GDB is Codesigned-see taskgated (8))
The reason is that GNU gdb is not allowed to access other processes by default in the Mac System (10.9), and GDB needs to be signed:
? ~ which gdb/usr/local/bin/gdb--> ~ codesign-s gdb-cert/usr/local/bin/gdb
The signed command is ' Codesign ', Gdb-cert is a certificate of his own making, followed by the signed process: '/usr/local/bin/gdb '
Here is the method of signing, resources from: <buildingondarwin><installing GDB on OS X mavericks>
Keychain Access--Certificate assistant--Create a certificate, in the Certificate assistant, create a certificate with the name Gdb-cert:
All the way ' continue ', there is an option to choose between:
Final Build:
After the build, register with ' codesign ' and restart the taskgated process
? ~ PS-E | grep taskgated 69?? 2:06.20/usr/libexec/taskgated-s84711 ttys002 0:00.00 grep--color=auto taskgated--> ~ sudo kill-9 69