Mac/C + + Debug method in Eclipse

Source: Internet
Author: User
Tags administrator password

The CDT plugin is installed in Eclipse, and the C + + code is written, run is normal, and today debug appears as Error


Baidu know, did not install GDB Debugging tools, then installed. Here's how:

1. Need to install a homebrew,homebrew is a package manager. Homebrew website Address: http://brew.sh/index_zh-cn.html

Homebrew Installation method: Open Terminal window, paste the following script

<span style= "White-space:pre" ></span>ruby-e "$ (Curl-fssl https://raw.githubusercontent.com/Homebrew/ Install/master/install) "

Wait for installation to complete

2. Install GDB and paste the following script in the terminal window

<span style= "White-space:pre" ></span>brew install HTTPS://RAW.GITHUB.COM/HOMEBREW/HOMEBREW-DUPES/MASTER/GDB.RB
3. After installing GDB, make the signing certificate, reference article: http://www.cnblogs.com/yinxiangpei/articles/3897701.html

3.1 Open keychain Access, create a certificate


3.2 Enter a name and select the type


3.3 Enter the validity period, the general default of 365 is good, that is, a year


3.4 then continue straight on until you create the screen, select the system, and create


3.5 Select the Gdb-cert certificate that you just generated, and double-click


3.6 in the certificate introduction, open Trust, and use this certificate when you choose to always trust


3.7. Signing the GDB

Restart your computer, open the shell, and then execute the following code:

Codesign-s Gdb-cert/usr/local/bin/gdb

GDB can debug go after completing the above work, but will prompt for the administrator password each time it is used.

3.8 Enables ordinary users to also use GDB

Since the previously produced certificate is under the system, each execution of GDB will prompt the administrator password, the solution is also very simple, open keychain access to the system below the Gdb-cert copy to the log on the line.

3.9 After installing GDB, check that the GDB installation is successful---> in the terminal window, enter: Gdb-version

4. Set the GDB path in eclipse


5. At this point, you are ready to debug C + + programs.

If the previous program has been set to Debug configurations, you need to reset


Mac/C + + Debug method in Eclipse

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.