vscode/windows 下调试 clang (lldb)

use*_*154 7 debugging clang lldb visual-studio-code

我正在尝试调试helloworld项目

#include <stdio.h>

int
main (void)
{
  printf ("Hello, world!\n");
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

它是使用clang构建的。我使用 vs-code 来执行这些操作。这是我的task.json文件:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "C/C++: clang.exe build active file",
            "command": "C:\\msys64\\mingw64\\bin\\clang.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

作为构建任务,它可以工作,但随后使用 launch.json 进行调试似乎没有任何进展。这是我的 launch.json 文件:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "clang.exe - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\lldb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: clang.exe build active file"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

如何使用 clang/lldb 在 vs-code 下设置调试器?

它在这个命令中停滞了

PS C:\c_helloworld>  & 'c:\.vscode\extensions\ms-vscode.cpptools-0.30.0-insiders5\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-2oaooq4b.u01' '--stdout=Microsoft-MIEngine-Out-ojuis1aj.kfb' '--stderr=Microsoft-MIEngine-Error-tcxqgdhj.tgp' '--pid=Microsoft-MIEngine-Pid-nam4qmgr.r4y' '--dbgExe=C:\msys64\mingw64\bin\lldb.exe' '--interpreter=mi'
Run Code Online (Sandbox Code Playgroud)