10

i am struggling to get my vscode working. it pops up this error. "Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option. option."

the code should be working alright, but there must be something im missing and my research in youtube tutorials was not very helpful.

pd im using OSX

here is my launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "linux": {
                "MIMode": "gdb",
                "miDebuggerPath": "gdb",
                "program": "${workspaceFolder}/bin/main"
            },
            "osx": {
                "MIMode": "lldb",
                "miDebuggerPath": "lldb-mi",
                "program": "${workspaceFolder}/bin/main"
            },
            "windows": {
                "MIMode": "gdb",
                "miDebuggerPath": "gdb.exe",
                "program": "${workspaceFolder}/bin/main.exe"
            },
            "preLaunchTask": "build"
        }
    ]
}
Dilan
  • 2,610
  • 7
  • 23
  • 33
Belén
  • 101
  • 1
  • 1
  • 3

2 Answers2

7

I had the same problem, it was solved by installing GDB (it does not come bundled with VS Code). In your case it seems like it is looking for lldb, here as a stackoverflow question that discusses installing lldb on osx.

niid
  • 473
  • 4
  • 13
1

If you actually have gdb installed, you need to set "miDebuggerPath" to its full file name including the path, i.e. "miDebuggerPath": "/path/to/gdb".

Note that if gdb is installed normally (in a directory listed in $PATH), then you don't need to specify "miDebuggerPath" at all.

PS. Recent versions of VSCode seem to use "gdbpath" parameter instead of "miDebuggerPath".

Dmitry Grigoryev
  • 3,156
  • 1
  • 25
  • 53