Skip to content

Unable to start debugging. Unexpected GDB output from command "-environment -cd". #10366

@Laxaro-Void

Description

@Laxaro-Void

Environment

  • OS and version: Windows 10 Pro 22H2
  • VS Code: 1.74.2
  • C/C++ extension: v1.13.9
  • GDB / LLDB version: GNU gdb 12.1

Bug Summary and Steps to Reproduce

Bug Summary:
Is unable to start debugging. Unexpected GDB output from command "environment -cd". I trying test and explore Visual Studio Code in depth, I start learning C++ like a weak ago.

I follow Mysy64 and C/C++ extension installation in VsCode web GCC on Windows, i check environment variables path to match C:\msys64\mingw64\bin.
Then I create a HelloWorld.cpp like in the article.
And try run the debugger.

I did the troubleshooting pacman -S --needed base-devel mingw-w64-x86_64-toolchain but no luck.

Debugger Configurations

launch.json:
{
    "version": "0.2.0",
    "configurations": [
    {
        "name": "C/C++: g++.exe build and debug active file",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
        "setupCommands": [
        {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        }
        ],
        "preLaunchTask": "C/C++: g++.exe build active file"
    }
    ]
}

task.json:
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: cpp.exe build active file",
            "command": "C:\\msys64\\mingw64\\bin\\cpp.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "Task generated by Debugger."
        },
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\\msys64\\mingw64\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

Debugger Logs

Window popup.
Unable to start debugging. Unexpected GDB output from command "-environment-cd" (file direction) "" (file direction):No such file or directory.

Other Extensions

C/C++ Extension Pack

Additional Information

image_2023-01-09_012149785

Metadata

Metadata

Assignees

No one assigned

    Labels

    debuggermore info neededThe issue report is not actionable in its current state

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions