Using Vscode to debug C

Source: Internet
Author: User
Tags gdb debugger

Recently in C language learning. Know that Vscode support the C language of the code debugging, want to try. Then I looked for the tutorial:

Https://code.visualstudio.com/docs/languages/cpp

Http://www.2cto.com/kf/201606/516207.html

Did not succeed in doing so. You can't hit a broken point.

Then it comes to the fact that GCC compiled the code, which makes it impossible to hit the breakpoint, and the GDB debugger may have some unique commands. Then search the Internet for information about GDB. It's easy to find this article:

http://blog.csdn.net/liigo/article/details/582231/

The first half of the article that solves my problem,

I realized that debugging is likely to need to use the-G parameter, and C # inside debug code to debug, release can not debug a reason. Finally successfully achieved the purpose of debugging C language code by Vscode. Here is my configuration and source code:

The final effect:

Using Vscode to debug C

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.