Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"error: unknown option: --interpreter=mi" trying to debug with lldb on Mac

I am receiving the "error: unknown option: --interpreter=mi" when trying to debug with lldb in VS Code on Mac for C++, Clang Compiler, and an OpenMP implementation. I am unable to debug because of it. Below is the launch.json then tasks.json

{
  "version": "0.2.0",
  "configurations": [
      {
          "name": "Build with Clang and OpenMP",
          "type": "cppdbg",
          "request": "launch",
          "program": "${workspaceFolder}/CS267/tom_2.1/build/openmp",  // Path to compiled binary
          "args": [],
          "stopAtEntry": false,
          "cwd": "${workspaceFolder}/CS267/tom_2.1/",
          "environment": [],
          "externalConsole": false,
          "MIMode": "lldb",  // Use LLDB for debugging
          "setupCommands": [
              { "text": "-enable-pretty-printing", "description": "Enable pretty printing", "ignoreFailures": true }
          ],
          "preLaunchTask": "Build with Clang and OpenMP",
          "miDebuggerPath": "/usr/bin/lldb"  // Path to LLDB on macOS
      }
  ]
}
{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "Build with Clang and OpenMP",
        "type": "shell",
        "command": "cmake",
        "args": [
          "--build",
          "${workspaceFolder}/CS267/tom_2.1/build"
        ],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "problemMatcher": ["$gcc"],
        "detail": "Generated task by debugging configuration."
      }
    ]
  }

I have tried editing the tasks.json and launch.json numerous times to no avail. Chat has not helped.

like image 553
superbadtunacan Avatar asked Dec 16 '25 21:12

superbadtunacan


1 Answers

I had the same problem. I was able to fix it with the following launch.json file:

{
   "version": "0.2.0",
   "configurations": [
      {
         "name": "LLDB: C++ debug the active target",
         "type": "cppdbg",
         "request": "launch",
         "program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
         "args": [],
         "stopAtEntry": false,
         "cwd": "${workspaceFolder}",
         "environment": [],
         "externalConsole": false,
         "MIMode": "lldb",
         "preLaunchTask": "C/C++: g++ build active file"
      }
   ]
}

with removed miDebuggerPath, setupCommands.

See also this https://github.com/microsoft/vscode-cmake-tools/issues/3908

like image 174
SternK Avatar answered Dec 20 '25 18:12

SternK