'VS Code doesn't show predefined launch.json files
I'm following This VSCode MinGW guide.Everything works fine until the debugging part, where I need to choose Run > Add Configuration... and then choose C++ (GDB/LLDB). After that, the guise writes that i should see a dropdown of predefined configurations, but that does not happen to me. Instead I get a launch.json file with no configurations. Inside launch.json i can use the Add Configuration.. button to create a C/C++:(gdb) Launch configuration so I tried the following:
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\g++.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 way when I start debugging, all I see is that it's loading, and I can't use debugging. For the task.json file it worked fine.
Edit: I found a working configuration, that would be:
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
but, i still don't understand why this one works, and the upper one doesn't. (changing the program configuration in the wrong launch.json file to match the new one doesnt have any effect)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
