0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 06: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

25
.vscode/launch.json vendored
View File

@ -4,9 +4,30 @@
// 访: https://go.microsoft.com/fwlink/?linkid=830387 // 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "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", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
@ -24,7 +45,7 @@
"ignoreFailures": true "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", "label": "build",
"type": "shell", "type": "shell",
// ggc -g ${file} -o ${fileDirname}${fileBasenameNoExtension}.exe
"windows": { "windows": {
"command": "g++", "command": "g++",
"args": [ "args": [
@ -15,12 +14,21 @@
"--save-temps" "--save-temps"
] ]
}, },
// "linux": {
"command": "/usr/bin/g++",
"args": [
"-g",
"\"${file}\"",
"-o",
"\"${fileDirname}/${fileBasenameNoExtension}.exe\"",
"--save-temps"
]
},
"problemMatcher": { "problemMatcher": {
"owner": "cpp", "owner": "cpp",
"fileLocation": [ "fileLocation": [
"relative", "relative",
"." // ${workspaceFolder} "."
], ],
"pattern": { "pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
@ -35,13 +43,31 @@
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
}, },
//
"presentation": { "presentation": {
"echo": true, "echo": true,
"reveal": "always", "reveal": "always",
"focus": false, "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"
// }
] ]
} }