Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

dlv not work #399

Closed
gatspy opened this issue Jul 19, 2016 · 18 comments
Closed

dlv not work #399

gatspy opened this issue Jul 19, 2016 · 18 comments

Comments

@gatspy
Copy link

gatspy commented Jul 19, 2016

Installation according to the installation document on OSX.
then F5,vs code show error message:Failed to continue: "Cannot find Delve debugger. Ensure it is in your GOPATH/bin or PATH."
vscode-go version:0.6.39
go version 1.6.3

run dlv debug test.go command in terminal its ok.

@lukehoban
Copy link
Contributor

Where is dlv installed on your system? Is it in your PATH or GOPATH\bin?

@blacktop
Copy link

are you supporting golang and dlv being installed via homebrew? It doesn't seem to be working anymore.

@blacktop
Copy link

when I try to debug I just get could not launch process: could not fork/exec

@lukehoban
Copy link
Contributor

lukehoban commented Jul 24, 2016

@blacktop That error indicates that dlv is not installed correctly. Can you run dlv debug from your project dir successfully?

@zontafil
Copy link

have the same issue, using fedora 23.
I installed dlv using go get and put I have put the go bin/ folder in both GOLANG and PATH.

dlv is working correctly (tried dlv debug in the project folder)

@blacktop
Copy link

@lukehoban so I also reinstalled delve manually as well as running the brew install and it works now.

However, it seems VERY buggy now and crashes and panics a lot.

I don't think I have successfully stepped once since the upgrade. However, maybe that is a delve issue and not a vscode-go issue?

@gatspy
Copy link
Author

gatspy commented Jul 29, 2016

the problem sloved, it's my GOPATH setting problems.
i linked an external ssd to my home. then GOPATH linked to this external ssd, but I don't use absolute path,so dlv crash.
vim-go also has a similar problem.GoDoc can't work #951

@zontafil
Copy link

I found out that my problem is specific to linux.
when vscode is started from a launcher, with the .desktop file, no env variables are set.

@zontafil
Copy link

Solved. I was setting GOPATH variable only for console and not Xorg applications

@gobijan
Copy link

gobijan commented Aug 2, 2016

For me it was a problem with the dlv version. I installed the latest from master and now it works again.

@IzakMarais
Copy link

I get the same message: Failed to continue: "Cannot find Delve debugger. Ensure it is in your 'GOPATH/bin' or 'PATH'. on Windows. Latest versions of delve (via go get) and vscode-go.

Using the GOPATH check in vscode:
Info: Current GOPATH:T:\Documents\werk\vagrant\shares\sea-server

Navigating to GOPATH/bin folder shows that delve is there:

dir
   Directory of T:\Documents\werk\vagrant\shares\sea-server\bin
...
2016-08-05  11:54 AM        15 894 528 dlv.exe

@mbobakov
Copy link

mbobakov commented Aug 7, 2016

I fix the same issue with
▶ rm -rf $GOPATH/src/github.com/derekparker
▶ go get github.com/derekparker/delve/cmd/dlv

Maybe it helps

@blacktop
Copy link

blacktop commented Aug 7, 2016

@lukehoban So I removed dlv from brew and with @mbobakov 's command and then reinstalled with brew and it is giving me the error again could not launch process: could not fork/exec, but in the folder running dlv debug works just fine. Is vscode-go not looking were brew installs it?

❯❯❯ which dlv
/usr/local/bin/dlv

@blacktop
Copy link

blacktop commented Aug 7, 2016

The plot thickens !!!

~/s/g/s/g/m/malice git:master ❯❯❯ $GOPATH/bin/dlv debug
could not launch process: could not fork/exec
~/s/g/s/g/m/malice git:master ❯❯❯ dlv debug
Type 'help' for list of commands.
(dlv) q

@blacktop
Copy link

blacktop commented Aug 7, 2016

I think this is because the version that brew signs with the dlv cert is the one it links to /usr/local/bin and not the one that was left behind in GOPATH/bin that is not working. When I removed it (GOPATH/bin/dlv) the vscode-go ext just hung forever. I am assuming not finding the brew installed one in my PATH?

@JinWuZhao
Copy link

I encounter this problem, too. But it works very well at past.

@ghost
Copy link

ghost commented Sep 27, 2016

I had this problem because my working directory wasn't the same as the directory of my source files. I just had to open the proper source folder and it worked.

@ramya-rao-a
Copy link
Contributor

For people who see "Failed to continue: "Cannot find Delve debugger. Ensure it is in your 'GOPATH/bin' or 'PATH'."

  • The debugger in the Go extension cannot read GOPATH from the user/workspace settings. You need to specifically set the GOPATH in the env property in the lanuch.json

  • If your GOPATH was set as env variable outside of VS Code and you didnt have to set GOPATH in user/workspace settings, then debugger can read the GOPATH set as env variable.

For people who see "could not launch process: could not fork/exec",

Closing this issue.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants