From ffc1a56e53eeec2e7c5feb41a2f35a44c135501e Mon Sep 17 00:00:00 2001 From: Mike Patnode Date: Sat, 18 Apr 2020 13:02:06 -0700 Subject: [PATCH] Add note about needing WSL 2 on Windows 10 to use delve (#3167) --- README.md | 2 +- docs/Debugging-Go-code-using-VS-Code.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7adc9d92..4d6cf8b2d 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ A few of these are available in the editor context menu as an experimental featu ### _Optional_: Debugging -To use the debugger, you must currently manually install `delve`. See the [Installation Instructions](https://github.com/derekparker/delve/tree/master/Documentation/installation) for full details. On MacOS it requires creating a self-signed cert to sign the `dlv` binary. +To use the debugger, you must currently manually install `delve`. See the [Installation Instructions](https://github.com/derekparker/delve/tree/master/Documentation/installation) for full details. On MacOS it requires creating a self-signed cert to sign the `dlv` binary. If using WSL on Windows, you will need the WSL 2 Linux kernel. See [WSL 2 Installation](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) and note the Window 10 build version requirements. For more read [Debugging Go Code Using VS Code](https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code). diff --git a/docs/Debugging-Go-code-using-VS-Code.md b/docs/Debugging-Go-code-using-VS-Code.md index 9dec596d8..59bc36059 100644 --- a/docs/Debugging-Go-code-using-VS-Code.md +++ b/docs/Debugging-Go-code-using-VS-Code.md @@ -234,6 +234,11 @@ You may see this in the debug console, while trying to run in the `test` mode. T **_Solution_**: Ensure that the `program` attribute points to the folder that contains the test files you want to run. +#### delve/launch hangs with no messages when using WSL +Try running ```delve debug ./main``` at the WSL command line and see if you get a prompt + +**_Solution_**: Ensure you are running the WSL 2 Kernel, which (as of 4/15/2020) requires an early release of the Windows 10 OS. This is available to anyone via the Windows Insider program. See [WSL 2 Installation](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) + #### could not launch process: could not fork/exec ##### OSX @@ -258,4 +263,4 @@ Check the version of delve api being used in the remote delve process i.e check #### Try using dlv from the terminal/command-line -Add `"trace": "log"` to your debug configuration and debug in VS Code. This will send logs to the debug console where you can see the actual call being made to dlv. You can copy that and run it in your terminal \ No newline at end of file +Add `"trace": "log"` to your debug configuration and debug in VS Code. This will send logs to the debug console where you can see the actual call being made to dlv. You can copy that and run it in your terminal