Skip to content

The absence of lldb-mi prevents debugging clang-compiled programs with gdb, meaning that even if the clang task is set as the default, the configuration still needs to be manually selected each time the program is run. #13081

Open
@vivodi

Description

@vivodi

Environment

  • OS and version: Windows 24H2
  • VS Code: 1.96.2
  • C/C++ extension: 1.22.11
  • OS and version of remote machine (if applicable): Ubuntu 24.04 WSL
  • GDB / LLDB version: 15.0.50.20240403-git

Bug Summary and Steps to Reproduce

Bug Summary:

Even when configured to use gdb to debug programs compiled with clang, the C/C++ extension still ignores the clang debug configuration due to the absence of lldb-mi. This results in the need to manually select the configuration each time the program is run, even if the clang task is set as the default.

Related issue: #12006, but this is not a duplicate (I'm not using lldb at all).

Steps to reproduce:

  1. I have already configured to use gdb instead of lldb to debug programs compiled with clang:
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
  1. C/C++ extension still shows:
Unable to find the "lldb-mi-19" debugger. The debug configuration for clang-19 is ignored.
Unable to find the "lldb-mi-19" debugger. The debug configuration for clang++-19 is ignored.

and I have to manually select the configuration each time the program is run, even if the clang task is set as the default:

"group": {
    "kind": "build",
    "isDefault": true
},

Image

Debugger Configurations

task.json:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++-19 build active file",
            "command": "/usr/bin/clang++-19",
            "args": [
                "-std=c++23",
                "-fstandalone-debug",
                "-fsanitize=undefined",
                "-fsanitize=address",
                "-fcolor-diagnostics",
                "-fansi-escape-codes",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

launch.json

{
    "configurations": [
        {
            "name": "C/C++: clang++-19 build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "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
                }
            ],
            "preLaunchTask": "C/C++: clang++-19 build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ],
    "version": "2.0.0"
}

C/C++ Extension Logs

Unable to find the "lldb-mi-19" debugger. The debug configuration for clang-19 is ignored.
Unable to find the "lldb-mi-19" debugger. The debug configuration for clang++-19 is ignored.

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdebuggerhelp wantedCan be fixed in the public (open source) repo.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions