3

I want to lauch gdb in vscode. I want to debug my c code using gdb in vscode , but i m getting following error :

unable to start debugging unexpected gdb output from command environment cd I have my gdb installed on wsl.

here is my 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:\\"
        }
    }
]

}

I am unable to debug my program

1 Answer 1

2

Well, two years too late, but here we go.

From what I saw, you are using windows. I had the same problem and quickly resolved it. Apparently it's some system bug. To resolve, follow these steps:

(Tested on Windows 10)

  1. Go to Windows Control Panel (You can do this by opening File Explorer and in the path type 'Control Panel' (without quotes) and hit Enter);

  2. From the Control Panel, click on 'Clock and Region'.

  3. Click Region. A new screen will open.

  4. In the screen that opened, click on Administrative and search for the button "Change system location".

  5. Check the option: "Beta: Use Unicode UTF-8 for world language support"

  6. Restart the computer.

By doing this procedure, the problem will be solved. I hope it has helped you and others who are experiencing this problem.

Sign up to request clarification or add additional context in comments.

1 Comment

problem fixed ! Thank so much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.