【问题标题】:unable to start debugging unexpected gdb output from command environment cd无法从命令环境 cd 开始调试意外的 gdb 输出
【发布时间】:2019-05-29 15:14:45
【问题描述】:

我想在 vscode 中启动 gdb。我想在 vscode 中使用 gdb 调试我的 c 代码,但出现以下错误:

无法从命令环境 cd 开始调试意外的 gdb 输出 我在 wsl 上安装了我的 gdb。

这是我的 lauch.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": "${workspaceFolder}\\bin\\main",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": true,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ],
        "pipeTransport": {
            "pipeCwd": "",
            "pipeProgram": "c:\\windows\\sysnative\\bash.exe",
            "pipeArgs": ["-c"],
            "debuggerPath": "/usr/bin/gdb"
        },
        "sourceFileMap": {
            "/mnt/z": "z:\\"
        }
    }
]

}

我无法调试我的程序

【问题讨论】:

    标签: visual-studio-code gdb windows-subsystem-for-linux


    【解决方案1】:

    嗯,迟了两年,但我们走了。

    据我所见,您使用的是 Windows。我遇到了同样的问题并很快解决了。显然这是一些系统错误。要解决,请按以下步骤操作:

    (在 Windows 10 上测试)

    1. 转到 Windows 控制面板(您可以通过打开文件资源管理器并在路径中输入“控制面板”(不带引号)并按 Enter 键);

    2. 在控制面板中,点击“时钟和区域”。

    3. 单击区域。将打开一个新屏幕。

    4. 在打开的屏幕中,单击“管理”并搜索“更改系统位置”按钮。

    5. 选中选项:“测试版:使用 Unicode UTF-8 支持世界语言”

    6. 重启电脑。

    通过执行此程序,问题将得到解决。 我希望它对您和遇到此问题的其他人有所帮助。

    【讨论】:

    • 问题已解决!非常感谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-10
    • 1970-01-01
    • 2016-04-16
    • 2010-10-27
    • 1970-01-01
    • 1970-01-01
    • 2020-10-28
    相关资源
    最近更新 更多