vsCode调试功能

This commit is contained in:
iridiumR 2021-10-21 20:58:58 +08:00
parent 978af22a7a
commit 3783c65a76
4 changed files with 11 additions and 55 deletions

View file

@ -13,7 +13,7 @@
"UNICODE", "UNICODE",
"_UNICODE" "_UNICODE"
], ],
"compilerPath": "C:/Project/mingw64/bin/gcc.exe", "compilerPath": "C:/Project/mingw64/bin/g++.exe",
"cStandard": "c17", "cStandard": "c17",
"cppStandard": "c++17", "cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64" "intelliSenseMode": "windows-gcc-x64"

6
.vscode/launch.json vendored
View file

@ -3,9 +3,11 @@
// //
// 访: https://go.microsoft.com/fwlink/?linkid=830387 // 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"label": "Compile",
"configurations": [ "configurations": [
{ {
"name": "gcc.exe", "name": "g++.exe",
"label": "Compile",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
@ -23,7 +25,7 @@
"ignoreFailures": true "ignoreFailures": true
} }
], ],
"preLaunchTask": "C/C++: gcc.exe 生成活动文件" "preLaunchTask": "Compile"
} }
] ]
} }

31
.vscode/tasks.json vendored
View file

@ -2,12 +2,14 @@
"tasks": [ "tasks": [
{ {
"type": "cppbuild", "type": "cppbuild",
"label": "C/C++: gcc.exe 生成活动文件", "label": "Compile",
"command": "C:/Project/mingw64/bin/gcc.exe", "command": "C:/Project/mingw64/bin/g++.exe",
"args": [ "args": [
"-fdiagnostics-color=always",
"-g", "-g",
"${file}", "${file}",
"-o", "-o",
"-fexec-charset=GB2312",
"${fileDirname}\\${fileBasenameNoExtension}.exe" "${fileDirname}\\${fileBasenameNoExtension}.exe"
], ],
"options": { "options": {
@ -16,31 +18,8 @@
"problemMatcher": [ "problemMatcher": [
"$gcc" "$gcc"
], ],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
},
{
"type": "cppbuild",
"label": "C/C++: g++.exe 生成活动文件",
"command": "C:\\Project\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build", "group": "build",
"detail": "编译器: C:\\Project\\mingw64\\bin\\g++.exe" "detail": "编译器: C:/Project/mingw64/bin/g++.exe"
} }
], ],
"version": "2.0.0" "version": "2.0.0"

View file

@ -12,30 +12,5 @@
}, },
"files.encoding": "gb2312" "files.encoding": "gb2312"
}, },
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "gcc.exe - 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "C:/Project/mingw64/bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Project\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe 生成活动文件"
}
]
}
} }