


准备工作:
使用ctrl+shift+p调出命令对话框,输入:task,选择:configure task runner,继续选择:others,即可产生tasks.json文件,改为如下内容:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gcc",
"isShellCommand": true,
"args": ["-g", "${file}", "-o", "${file}.exe"],
"showOutput": "always"
}
将“program”的值改为:
"program": "${file}.exe",
顺便在下面加上一行:
"miDebuggerPath": "C:\MinGW\bin\gdb.exe",
这里的miDebuggerPath即为gdb的安装路径。
按F5即可开始调试