0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

[Add] Debug (Linux)

This commit is contained in:
Baoshuo Ren 2020-10-04 15:26:53 +08:00 committed by Baoshuo Ren
parent 6acdcd5083
commit a333d24910
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68
2 changed files with 56 additions and 9 deletions

29
.vscode/launch.json vendored
View File

@ -1,12 +1,33 @@
{
// 使 IntelliSense
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "[Linux] C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build"
},
{
"name": "C++ Launch (GDB)",
"name": "[Windows] C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
@ -24,7 +45,7 @@
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
"preLaunchTask": "build"
}
]
}
}

36
.vscode/tasks.json vendored
View File

@ -4,7 +4,6 @@
{
"label": "build",
"type": "shell",
// ggc -g ${file} -o ${fileDirname}${fileBasenameNoExtension}.exe
"windows": {
"command": "g++",
"args": [
@ -15,12 +14,21 @@
"--save-temps"
]
},
//
"linux": {
"command": "/usr/bin/g++",
"args": [
"-g",
"\"${file}\"",
"-o",
"\"${fileDirname}/${fileBasenameNoExtension}.exe\"",
"--save-temps"
]
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"." // ${workspaceFolder}
"."
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
@ -35,13 +43,31 @@
"kind": "build",
"isDefault": true
},
//
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared" // shared=new=
"panel": "shared"
}
}
// ,
// {
// "type": "shell",
// "label": "C/C++: g++ build active file",
// "command": "/usr/bin/g++",
// "args": [
// "-g",
// "${file}",
// "-o",
// "${fileDirname}/${fileBasenameNoExtension}"
// ],
// "options": {
// "cwd": "${workspaceFolder}"
// },
// "problemMatcher": [
// "$gcc"
// ],
// "group": "build"
// }
]
}