Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Dec 27, 2024 · 1 comment
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.

Comments

@vivodi
Copy link

vivodi commented Dec 27, 2024

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.
@sean-mcmanus sean-mcmanus added debugger help wanted Can be fixed in the public (open source) repo. bug labels Dec 27, 2024
Copy link

Thank you for reporting this issue. We’ll let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.
Projects
None yet
Development

No branches or pull requests

2 participants