Type: Debugger
Input information below
Describe the bug
When trying to debug using WSL, it will always get stuck with no output. And when I tried to type command in debug console, it says that "Please start a debug session to evaluate". Seems that it can't start the gdb correctly. When I press the Stop button, I can't restart the debug operation. It has no opts at all. The only way to restart debugging is to relaunch VS Code.
This is my launch.json:
{
"name": "(gdb) Bash on Windows Launch",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "WSLbuild",
"program": "/mnt/e/Documents/unix_learning/apue.3e/{fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "/mnt/e/Documents/unix_learning/apue.3e/",
"environment": [],
"externalConsole": true,
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "${env:windir}\\system32\\bash.exe",
"pipeArgs": ["-c"],
"pipeCwd": ""
},
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
},
This is the task.json
{
"label": "WSLbuild",
"type": "shell",
"command": "g++",
"args": [
"-g","${fileBasename}","-o","${fileBasenameNoExtension}.out"
],
"group": {
"kind": "build",
"isDefault": true
}
}

@Stonepia Can you confirm it is Windows 10 Pro version 1803? Also confirm that if you comment out the build task, if it debugs?
@pieandcakes Yes I'm in 1803, and the WSL version is Ubuntu 18.04. I tried to comment out the build tasks , it still doesn't work.
@Stonepia I assume you updated to 1803. Have you opened a WSL terminal window since the update? Mine did a one time upgrade (wondering if that is what it is hanging on).
This was an issue that the WSL team said they fixed in 1803 so I'm surprised you are still running into it.
Yes I do in 1803, and the OS build is 17134.112 . I even reinstall the WSL . I was wondering what's going on, even the intelliSense works fine. But the debugging is stuck. The interesting thing is, I install the system in VMware and do these operations, it works fine. So is there any way to get the log file to locate what's happening?
This is the result about my OS build :
Windows : Version 1803 (OS Build 17134.112)
$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
OK I figured this out. It falls to the Region Settings. I have click on the option of Beta: Use Unicode UTF-8 for worldwide language support in Clock and Region -> Change date, time, or number formats -> Administrative -> Change system locale.
Most helpful comment
OK I figured this out. It falls to the Region Settings. I have click on the option of Beta: Use Unicode UTF-8 for worldwide language support in
Clock and Region -> Change date, time, or number formats -> Administrative -> Change system locale.