Type: Debugger
Describe the bug
To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:
Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.


If you access Help->Toggle Developer Tools->Console do you see a call stack for that error?
You're using 1.1.2 of the extension, right?
Also, any other repro details?
I second this.
Using 1.1.2.

Looks like this commit might cause the problem.
https://github.com/microsoft/vscode-cpptools/commit/df8523e5509bf8cb2cdde0805c8d9cc87117c8d4
@gegogi Thanks for the info -- you are correct.
It appears to be line https://github.com/microsoft/vscode-cpptools/blob/release/Extension/src/Debugger/configurationProvider.ts#L158 (or the similar one). I repro the bug when I delete the "command" field in my tasks.json. Does your tasks.json not have a "command" field for some reason? Do you have a C/C++ compiler installed?
This is my tasks.json and it has command field.
Compiler (VC Toolset) is also installed and I can compile.
Is there any way that I can debug against my local installation of cpptools?
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Build",
"command": "cl.exe",
"args": [
"/I",
"${workspaceFolder}\\..\\sqlite",
"/Zi",
"/EHsc",
"/Fe:",
"${fileDirname}\\${workspaceFolderBasename}.exe",
"main.c",
"..\\sqlite\\sqlite3.lib"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$msCompile"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: cl.exe"
}
],
}
That's okay -- I figured it out (see https://github.com/microsoft/vscode-cpptools/pull/6539). A workaround is to change the task's "type" from "shell" to "cppbuild".
When I use "cppbuild", it does not expand variable like ${workspaceFolderBasename} in compiling.
That's why I use "shell".
@gegogi Thanks for letting us know -- fixed with https://github.com/microsoft/vscode-cpptools/pull/6539/commits/ad9f80789efddbc4a0691a63d626ee7a1c8fbc08 . Unfortunately the workaround mentioned previously doesn't work in that case.
Well, a potential workaround is to use 1.0.1 (until we can get a 1.1.3 or 1.2.0-insiders released).
I changed the "type" in task.jason from "shell" to "cppbuild", now it works, thanks a lot for your help @sean-mcmanus, attached is my task.jason file.
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Generated task by Debugger"
}
],
"version": "2.0.0"
}
Most helpful comment
I changed the "type" in task.jason from "shell" to "cppbuild", now it works, thanks a lot for your help @sean-mcmanus, attached is my task.jason file.
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Generated task by Debugger"
}
],
"version": "2.0.0"
}