Created
November 11, 2023 16:15
-
-
Save sabinM1/18e7423e51a659958cc51c264a328bcd to your computer and use it in GitHub Desktop.
VSCode C++ tasks for Windows; shortcut "run build task" to F5; launch.json only for debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(gdb) Launch", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe", | |
"args": [], | |
"stopAtEntry": false, | |
"cwd": "${fileDirname}", | |
"environment": [], | |
"externalConsole": false, | |
"MIMode": "gdb", | |
"postDebugTask": "C++ run", | |
"miDebuggerPath": "C:\\msys64\\usr\\bin\\gdb.exe", | |
"setupCommands": [ | |
{ | |
"description": "Enable pretty-printing for gdb", | |
"text": "-enable-pretty-printing", | |
"ignoreFailures": true | |
}, | |
{ | |
"description": "Set Disassembly Flavor to Intel", | |
"text": "-gdb-set disassembly-flavor intel", | |
"ignoreFailures": true | |
} | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"type": "shell", | |
"label": "(gdb) Launch 1", | |
"command": "C:\\msys64\\ucrt64\\bin\\g++.exe", | |
"args": [ | |
"-g", | |
"${fileDirname}\\*.cpp", | |
"-o", | |
"${fileDirname}\\${fileBasenameNoExtension}.exe" | |
], | |
"options": { | |
"cwd": "${workspaceFolder}" | |
}, | |
"problemMatcher": [ | |
"$gcc" | |
], | |
}, | |
{ | |
"type": "shell", | |
"label": "C++ run", | |
"command": ".\\${fileBasenameNoExtension}.exe ; echo `0", | |
"dependsOn": [ | |
"(gdb) Launch 1" | |
], | |
"dependsOrder": "sequence", | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment