Configure Eclipse + GDB in your Mac

Source: Internet
Author: User
Tags gdb debugger

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


Related Article

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.