-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug: detach leaves the delve or the debugee hang (remote) #497
Comments
To add to this, I realized I was a couple of minor versions behind for go so I updated and rebuilt my server and I still cannot see the variables for certain breakpoints. My go version is now 1.14.7 Also because I did not specify I am on Pop!_OS 20.04. |
@leggettc18 Can you please compile the go code with the flags as described in https:/golang/vscode-go/blob/master/docs/debugging.md#try-building-your-binary-without-compiler-optimizations (or see https://golang.org/doc/gdb#Introduction) |
Yeah I can try that tonight, not able to get in front of my computer at the moment. |
So I tried the command listed at the first link and got this:
After that I tried just |
@leggettc18 drop the |
Ah I see, so the |
So that's the variable issue solved, there is still the other issue though, where if I detach from the delve instance, I can't reconnect. I can work around that by restarting the delve instance, but I would prefer not to if I can help it. |
@leggettc18 can you please add logging (instruction: https:/golang/vscode-go/blob/master/docs/debugging.md#enable-logging) and share the trace when you detach? |
From my terminal where the dlv instance is running:
VSCode debug log
|
@leggettc18 I just noticed there is a breakpoint setup (not sure how it happened because I don't see it from the VSCODE debug log, but see from your terminal log). I just encountered a similar issue but realized I detached without clearing the breakpoints, and wondered if uncleared breakpoints left the debugee hang. |
@leggettc18 |
You cannot reconnect to a dlv server if it is not running in a mode that supports multiple client connections ( |
The issue title ("detach leaves the delve or the debugee hang") suggests two problems.
|
As I have not heard a confirmation that 2 was indeed a known (as opposed to suspected) problem, I propose closing this as per 1 as a duplicate of #748. |
@polinasok thanks for the followup. |
Please direct general questions to:
#vscode
channel in Gophers SlackPlease review the documentation before filing an issue.
Helpful pages include:
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersRun
go env
to get the go development environment detailsAlso using Delve version 1.5.0
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
I have a couple of weird issues with the vscode debugger attaching to a headless delve instance. One or both of these may be delve instances, but I'm pretty sure they are vscode debugging issues.
First off, here is my
launch.json
fileI build my code with
go build -o $GOPATH/bin/devmarks -i
(which you can find here) and run the server with devmarks serve. Then in another terminal I run delve in headless modedlv attach --headless --listen=:2345 --api-version=2 $(pgrep devmarks)
Then I run the debugger, put in some breakpoints, and make an API request to my server. That's when the odd stuff starts.Firstly whenever my breakpoint is in any of the files (out of the ones I've tried so far at least) in the
api
folder (api/bookmark.go
for example, I can't see the variables in the side window. I also do not see them in the debug console. If I put the breakpoint in theapp
folder somewhere (for example inapp/bookmark.go
, I can see the variables just fine, and can also see them in the debug log (although I may need to hide and unhide the variables pane to make it show up, if I do that in the api folder I get the Local and Global headers but it just spins).To add to that, if I stop VSCode's Debugger for whatever reason, I can't reconnect to it without quitting my server's process and restarting both it and delve. Delve's logs don't appear to indicate any errors or crashes.
Steps to reproduce the behavior:
devmarks serve
dlv attach --headless --listen=:2345 --api-version=2 $(pgrep devmarks)
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
The text was updated successfully, but these errors were encountered: