using the GDB debugger in a newer OS X can occurUnable   to   find   mach   task   port error, which is due to The new OS X kernel prohibits unauthorized programs from arbitrarily controlling other processes, and we can use program signatures to solve this problem without root privileges. (Who wants to always debug normal programs with root privileges?) )
Open keychain access by going to the applications-and-utilities tool:
Select Menu Keychain Access, certificate Assistant, create a certificate, the first step is set up as follows:
Then keep next, and the last one is set up as follows:
Finally go back to the Keychain Access Program main screen, right-click on the newly created certificate, select Show Introduction, then expand the Trust entry, tick always trust at code signing.
in the console into the GDB program directory, enter: codesign-s gdb-cert gdb, OK, after finishing the call, note that to restart the Mac, signature settings to take effect oh.
Children who have been under windows for years are fond of debugging with a GUI-like debugger, as well as graphical debuggers in the UNIX like system, such as the famous CodeLite and codeblocks with their own debuggers. But as the well-known gdb most fit the front-end of the graphical debugger ddd is also very important, it and gdb are very dense, the function is very strong, recommend everyone to use.
Finally, note that if you use the sudo ddd Debug program under OS X, you will find ddd long time in a "daze" shape, unable to debug the program, the status bar total display: Waiting until gdb ready information, then don't panic, direct RM-RF ~/.ddd Folder can be.