VSCode C++ WSL 调试配置

时间:2021-07-27 08:01:52

标签: c++ visual-studio-code windows-subsystem-for-linux

我正在尝试在 vscode 中的 wsl 上调试 c++ 文件,调试器是 gdb。
这是我的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": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": ["../../lib/protolib/crestmessage.proto", "../protobuf_practice/messages.txt", "CrestMessage", "1"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "sourceFileMap": {
                "/mnt/c": "c:\\"
            },
            "miDebuggerPath": "/mnt/c/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gdb.exe"
        }

    ]
}

并报如下错误: enter image description here

0 个答案:

没有答案