named launch.json file

Run and debug executables built by CMake.
Pass arguments, environment variables, and control debugger behavi
This commit is contained in:
dl92
2026-01-08 00:44:03 +00:00
parent 685f69610c
commit 3da724f42f

39
cplusplus/learning/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,39 @@
{
// 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": "Run tut1",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/tut1/tut1",
"args": ["arg1", "arg2"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Run tut2 with options",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/tut2/tut2",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [
{ "name": "MY_FLAG", "value": "1" }
],
"externalConsole": true,
"MIMode": "gdb"
}]
}