microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

No installed `lldb` debugger is automatically discovered on newer macOS versions #3706

Open talyz opened 5 months ago

talyz commented 5 months ago

On newer versions of macOS and XCode, the lldb debugger is not found automatically and neither is the lldb-mi that is packaged with the cpptools extension.

lldb

lldb isn't found seemingly because it's looked for in the same directory as the compiler, whereas it's actually installed globally, in /usr/bin.

lldb-mi

lldb-mi goes undiscovered seemingly because searching for it is predicated on finding lldb-mi in the compiler path. lldb-mi isn't shipped with XCode, so this check fails. I'm not sure when it would succeed and regardless, it seems strange to be looking for it in one place just to find it in another, but maybe I'm missing something. This check was introduced in #1315, but doesn't provide much context for the change.

The workaround for this is to explicitly set

{
    "cmake.debugConfig": {
        "MIMode": "lldb"
    }
}

in settings.json, which bypasses the aforementioned check. However, it's not convenient to configure this on every new development setup and adding it to the workspace settings creates problems on other platforms.

gcampbell-msft commented 5 months ago

@talyz Thanks for posting this issue! I'm glad there is a workaround. We'll add it to the backlog as we agree, it's not the most convenient.

v-frankwang commented 5 months ago

@talyz I'm not sure if this is reproducing the problem, can you give me some advice?

Screenshot 2024-04-24 at 5 03 56 PM