Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vs-code launch.json showing error for cpp debugger

launch.json file for cpp debugging is showing error. help me to rectify it

{
    "version": "0.2.0",
    "configurations": [
      

      {
        "name": "g++.exe - Build and debug active file",
        "type": "by-gdb",
        "request": "launch",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": true,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\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"
      }
    ]
  }

It is showing 7 errors in it

Property args is not allowed.
Property stopAtEntry is not allowed.
Property environment is not allowed.
Property externalConsole is not allowed.
Property MIMode is not allowed.
Property miDebuggerPath is not allowed.
Property setupCommands is not allowed.
like image 986
Rahul Kumar Avatar asked Apr 25 '26 07:04

Rahul Kumar


1 Answers

Change "type" to "cppdbg".

This isn't documented anywhere but half the extra debugging properties for C++ don't work if your type is not "ccpdbg" (if you're debugging gdb or lddb) or "cppvsdbg" if you're debugging with VS.

I ran into the same issue when using "type": "lldb".

like image 158
Nikita240 Avatar answered Apr 27 '26 20:04

Nikita240