Troubleshoot problems that GDB cannot debug under OS X

Source: Internet
Author: User
Tags gdb debugger

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.