Comments (26)
Hello I've installed delve via brew.
So in terminal this command works perfect:
dlv debug main.go
(no root user)
However I still get error in vscode:
2016/09/14 18:18:36 server.go:71: Using API v1
2016/09/14 18:18:36 debugger.go:61: launching process with args: [./debug]
could not launch process: could not fork/exec
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"showLog": true
}
]
}
dlv version
Delve Debugger
Version: 0.11.0-alpha
Build: v0.11.0
go version
go version go1.7.1 darwin/amd64
from vscode-go.
@bruparel Sounds like you are not in the right directory. You need to be in the directory where you cloned https://github.com/derekparker/delve before you run make install
.
from vscode-go.
Thanks!
I solved the problem, here is my step:
- brew uninstall delve
2.delete the keychain for delve
3.Manual install the delve through the instruction (https://github.com/derekparker/delve/blob/master/Documentation/installation/osx/install.md)
from vscode-go.
Yeah - dlv
is invoked as a normal user, so if you have signed dlv
such that it cannot be used as a normal user it will not work with the VS Code integration currently.
I'm not sure of options for working around this, other than distributing our owned signed binary along with the plugin.
Thoughts?
from vscode-go.
The first thing might be to not tell users to go get
delve on this page: https://marketplace.visualstudio.com/items/lukehoban.Go It looks like the issue I'm encountering is due to the fact that I installed on OS X without noticing that I should be signing the binary. I'm also not getting any errors being reported or logs so it's a bit hard to understand what's wrong. I'll properly reinstall delve and see if it helps :)
from vscode-go.
So, from the delve Wiki:
https://github.com/derekparker/delve/wiki/Building
Installing on Mac OSX, there really doesn't seem to be anything regarding USER here. So, the self-signing cert seemed to work. I wonder what I'd need to do differently to make this work.
Did you try this on Mac OS? Just curious... if others are having this experience. I also agree with @mattetti that I was almost drawn off by the go get.
from vscode-go.
Alright, so after reinstalling with the cert, everything looks good with the exception of my local variables not showing up (but hovering them in my code displays the values)
from vscode-go.
So, uninstalling delve, what did you do? I feel like I did it right the first time, but then after it didn't work, I did the go get
- maybe if I start over with that... @mattetti
from vscode-go.
@caledhwa I went into the delve repo that I go get'd, created a cert and used make install
with the cert info to rebuild and reinstall delve.
from vscode-go.
That's right - the instructions on installing Delve are here: https://github.com/derekparker/delve/wiki/Building. On OS X this requires creating a self-signed cert and then using that to CERT=dlv-cert make install
.
I've modified the README to not suggest go get
for Delve since that won't work on OS X.
I'll leave this open to track reporting a better error message when a non-signed dlv binary is installed.
from vscode-go.
We're now reporting back the errors from Delve itself, so you'll get the same somewhat cryptic error that Delve provides to tell you that you don't have a signed dlv
:
2015/11/21 18:51:15 debugger.go:56: launching process with args: [./debug]
could not launch process: could not fork/exec
That will be enough to easily search for the issue. I'll leave communicating this failure case more explicitly to Delve itself for now.
from vscode-go.
Thanks for this! 👍 I just need to figure out what I did wrong when I signed Delve.
from vscode-go.
FWIW - The most common issue I've seen has been accidentally missing this step:
In keychains select “System”, and you should find your new certificate. Use the context menu for the certificate, select “Get Info”, open the “Trust” item, and set “Code Signing” to “Always Trust”.
from vscode-go.
I also got some errors while building delve. I had to do following to get additional packages and depenecies..(on Mac)
go get github.com/peterh/liner
go get github.com/spf13/cobra
go get gopkg.in/yaml.v1
go get golang.org/x/sys/unix
go get gopkg.in/yaml.v2
Then CERT=dlv-cert make install worked and I am able to debug the programs.
Looks like there are still some issues with adding variables to watch window ( or may be its user error). But glad to have gotten so far
from vscode-go.
I am new to Go and Delve both, therefore, I am sure I am doing something wrong. I am on a Mac using OS X. I followed Derek's instructions for 'Building'. The last bullet item says:
Run the following: CERT=dlv-cert make install, which will install the binary and codesign it.
Which binary are we installing? When I ran the command at the command prompt in my home directory, I get the following response:
Bharat:~
→ CERT=dlv-cert make install
make: *** No rule to make target `install'. Stop.
I named my cert 'dlv-cert'.
Please help.
from vscode-go.
@lukehoban Thank you. That worked.
from vscode-go.
@erm0l0v I am facing an exact same issue, did you able to solve it?
from vscode-go.
@erm0l0v I encounter this problem, too. dlv can work under terminal, but doesn't work under IDE vscode. help!
from vscode-go.
Same issue.
2016/12/26 22:44:41 debugger.go:55: launching process with args: [./debug]
2016/12/26 22:44:42 server.go:301: method Run has wrong number of ins: 1
2016/12/26 22:44:42 server.go:301: method Stop has wrong number of ins: 2
2016/12/26 22:44:42 debugger.go:239: continuing
Hello World!
101
When running a very simple Hello World. Breakpoints are "bypassed" and the program simply complete like if it is not in debug mode.
It perfectly works with dlv command line.
I'm on MacOSX 10.11.6, delve is installed from homebrew - certificate is well created.
Simple Hello World program used.
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
i := 101 // Where I put the breakpoint
fmt.Println(i)
}
from vscode-go.
@roblourens can you take a look at this?
from vscode-go.
This seems kind of far from the original issue so hopefully I'm not missing a thread. @erm0l0v that error message could not launch process: could not fork/exec
would probably be coming from your code, so I don't know why it would be working via command line but not vscode. Could that be the case?
@ThreeBearsDan Do you see that exact error message or do you just share the issue that it works via CLI but not vscode? Can you post the console output?
@danbricedatascience What's your delve version? That was a delve bug at some point at least - https://github.com/derekparker/delve/issues/378
from vscode-go.
@roblourens Currently debug works for me well. Problem was in certificate.
During first debug session OS ask me about root password and after filling password debug starts working in console but not in vs-code. This confused me and I am complained this problem.
@ThreeBearsDan @danbricedatascience Please try to restart system and run debug if OS ask you about root password - that mean that you have some issue with certificate (as I understand).
I did several steps to fix this problem and don't remeber which of the helped me. Probably it was manual installation of delve
from vscode-go.
@roblourens Version: 0.11.0-alpha
@erm0l0v Restart MacOS X does not change anything.
I will try manual installation of delve instead of brew.
from vscode-go.
I have the same problem
work well on Terminal
but still fail on vscode
anyone help?
I use brew install delve
from vscode-go.
@roblourens I am sorry for late reply. That work well now. I do nothing, just upgrade vsnode to Version 1.7.1. So I think it must be something wrong with vscode.
@erm0l0v Thank u. It's not the issue with certificate. I think it's the issue with vscode. I just upgrade vscode and it work well.
from vscode-go.
@skeleton1231. @ameykpatil Let's use #717 to track the issue where you get the error
server.go:71: Using API v1
debugger.go:61: launching process with args: [./debug]
could not launch process: could not fork/exec
This is coming from delve it self and #717 is tracking this.
@erm0l0v @ThreeBearsDan Glad to hear that you are unblocked now.
Anyone else coming to this thread with the same error as above, please see #717 , #269 and https://github.com/derekparker/delve/issues/357
from vscode-go.
Related Issues (20)
- go.formatFlags not working with gofmt -s (simplify) HOT 5
- Couldn't start client gopls HOT 5
- Unable to run Go in VS Code - command not found HOT 4
- Adding a module using `go get` from outside vscode is not recognized until go.mod is reopened HOT 5
- Can not use VS code for GO: Installing github.com/go-delve/delve/cmd/dlv FAILED HOT 5
- Disable real-time syntax error highlighting with gopls HOT 1
- Problem in mouse hover tooltip HOT 3
- Automatically Infer Path Mapping for Remote Debugging
- // .*DO NOT EDIT.?$ HOT 6
- Extension issue HOT 1
- 0.14.2 broken on macos HOT 3
- Extension Repository Migration Plan HOT 1
- Region comments not working when extension is enabled HOT 3
- Debugging uses wrong working directory HOT 4
- Background of covered and not covered code cannot be removed after running package test HOT 9
- Extension Migration Plan HOT 4
- numeric constants containing underscore are not colored correctly HOT 1
- Gopls does not support versions of go <=1.12 HOT 2
- Unable to set breakpoint when using gutter and clear Code coverage HOT 3
- Updated to 0.14.3 or the nightly and entirely stopped working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-go.