Troubleshoot gdb prompt signature error on Mac

Source: Internet
Author: User

Hint above GDB signature error.

Reason

Darwin Kernel For security reasons, GDB is not allowed to debug any program without special authorization because it can be debugged to control the process. However, if the root user does not have this problem, but who would like to use root to debug the program.

Solve

A common workaround is to give gdb the code signing right to fully trust the system to other processes.

First, you need to create a system code signing trust certificate:

    1. Launch the Keychain Access app (/applications/utilities/keychain Access.app)
    2. Open Menu: Keychain Access-"certificate Assistant-" Create Certificate ...
    3. Enter the name of the certificate, such as: Gdb-cert;
    4. Select identity type: Self-signed root certificate (identity type to signed root)
    5. Select certificate Type: Code signature (Certificate type to code Signing)
    6. TICK: Let me override these default signatures (select the Let me override defaults)
    7. Go all the way until you choose to store the certificate address, select: System
    8. The certificate is created, and the certificate custom Trust is set
    9. Right-click the Gdb-cert certificate you just created, select "Get info"
    10. Click Trust to display the trust options that can be customized
    11. "Code Signing" select "Always Trust" (Code Signing

Second, grant the certificate to GDB and execute the command

>codesign-s Gdb-cert/path to GdB

Note that you need to exit the Keychain Access app first, or restart the system

View/path to GDB, execute command

>which GDB

Well, the above gives GDB a code signing certificate that the system trusts, and GDB can be used normally.

Troubleshoot gdb prompt signature error on Mac

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: info-contact@alibabacloud.com 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.