4

I am using VS Code to debug 'C' code using Windows Subsystem for linux. I basically want to compile the 'C' code using a linux based compiler for a Operating System's course. I have set the default terminal to 'WSL' on Visual Studio Code. On clicking the debug button I am getting the below error 'Unable to start debugging. The value of miDebuggerPath is invalid' I verified that 'gdb' is installed in the Windows Subsystem for Linux and its executable (ELF File) is present in '/usr/bin/gdb' location

This is m 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": "${workspaceFolder}/temp",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            //"preLaunchTask": "Compile C Ubuntu"
        }
    ]
}

Any direction will be helpful :)

1
  • VS Code on Windows Commented Sep 15, 2018 at 23:46

1 Answer 1

2

The issue you are running into is the missing remoting call using bash.exe that is needed to call the debugger on the WSL site. You will need to add a section called "pipeTransport": and configure it. For more information, there is a how-to document located here.

You can find additional information on our extension's GitHub site at https://github.com/microsoft/vscode-cpptools.

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

Comments

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.