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