Skip to content

Instantly share code, notes, and snippets.

@potat-dev
Created September 28, 2022 23:36
Show Gist options
  • Save potat-dev/3e2adf6c15152dd58d45f8424b093d9b to your computer and use it in GitHub Desktop.
Save potat-dev/3e2adf6c15152dd58d45f8424b093d9b to your computer and use it in GitHub Desktop.
VS Code MinGW g++ debug tasks
{
"version": "0.2.0",
"configurations": [
{
"name": "build file",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/compile/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active file"
},
{
"name": "build folder",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/compile/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active folder"
},
{
"name": "build folder & subfolders",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/compile/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active folder & subfolders"
}
]
}
{
"tasks": [
{
"type": "cppbuild",
"label": "g++ build active file",
"command": "g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${workspaceFolder}/compile/${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "g++ build active file"
},
{
"type": "cppbuild",
"label": "g++ build active folder",
"command": "g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"*.cpp",
"-o",
"${workspaceFolder}/compile/${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "g++ build active folder"
},
{
"type": "cppbuild",
"label": "g++ build active folder & subfolders",
"command": "g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"*.cpp",
"*\\*.cpp",
"-o",
"${workspaceFolder}/compile/${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "g++ build active folder & subfolders"
}
],
"version": "2.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment