调试没有任何结果输出,代码可以用Run Code
运行,但是不能调试。
tasks.json中presentation的面板panel设置为new
g++.exe所在目录添加到系统PATH中。
task.json里
{
"label": "g++debug",
"type": "shell",
"command":"g++.exe",
"args": [
"${file}",
"-g",
]
},
launch.json里
{
"name": "G++ Debug",
"type": "cppdbg",
"preLaunchTask": "g++debug",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},