3

That's a question that goes hand in hand with this one here.

Difference: in the linked question I am using GoLand from within WSL (having Run Target set to its default which is "Local Machine") and in this question I am using GoLand from outside WSL (i.e. from the Windows host) using Run Target set to WSL2.

What I am struggeling with (since days now), is to debug go code using the IDE GoLand and using their feature of Run Targets, which is set to WSL 2.

My Go source files are on my Windows host system, the GO SDK is installed in both the Windows host and the WSL subsystem.

  • Windows Host: Windows 10
  • Inside WSL2: Ubuntu 20.04.03
  • Go: 1.18.2
  • GoLand: 2022.1
  • Delve: 1.8.2

go build, go run and even go install works fine, but debugging hangs shortly after the debugger started showing me this output:

enter image description here

That's my Go code:

enter image description here

This is my run/debug configuration:

enter image description here

And within the run/debug configuration, that's my target:

enter image description here

Note, that the debugger seems to be still up, since the process dlv is still there and I can cancel the debugging (it's just simply hanging without even starting the debugging):

enter image description here

And these are my Go environment variables:

enter image description here

I also found some discussions, which are maybe about the same subject, and I tried everything out that I could and found there, but without any luck. See:

https://youtrack.jetbrains.com/issue/GO-10846

https://github.com/microsoft/vscode-go/issues/2505

https://github.com/microsoft/WSL/issues/2977

marc wellman
  • 5,808
  • 5
  • 32
  • 59

0 Answers0