microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

macOS lldbinit not loaded #12580

Open dtomarepo opened 4 weeks ago

dtomarepo commented 4 weeks ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: VSCode LLDB does not load ~/.lldbinit file content (.lldbinit in project dir is also not loaded).

Steps to reproduce:

  1. MacOS C++ project that is running, My app sends signal to itself that should not cause breakpoint.
  2. ~/.lldbinit "pro hand -p true -s false -n true SIGUSR1"
  3. Use Run and Debug to launch process and debug it using lldb.
  4. Process receives signal and causes breakpoint instead of skipping it.

Debugger Configurations

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(lldb) myprogram",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/src/main/myprogram",
            "args": [
                "--nodaemon"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [
                {
                    "name": "MY_HOME", 
                    "value": "${env:MY_HOME}"
                },
            ],
            "externalConsole": false,
            "MIMode": "lldb",
        }
}

Debugger Logs

na

Other Extensions

No response

Additional Information

Opening lldb in VSCode console and executing lldb command shows that config is then loaded (so it's correct), but VSCode seems to ignore it. Using Clion as alternative works as expected.

dtomarepo commented 3 weeks ago

changing type to "type": "lldb" and configuring this extension also solves the problem:

"lldb.launch.initCommands": [
    "command source ${env:HOME}/.lldbinit"
],