-
Notifications
You must be signed in to change notification settings - Fork 646
Debug Attach doesn't work #1599
Comments
Next is not available cause the program didn't hit a breakpoint, and it didn't hit a breakpoint cause it was already running when you attached and so it missed the first few breakpoints and so the first breakpoint it will hit from the screenshot is line 13 which will only hit when you send a http request after attatching. |
@AlexRouSg Yes I know it and I did send a request via |
From: https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code#remote-debugging |
So after some checking I found the source of your issue. The problem is not that attach doesn't work, it works just fine. The problem is that you are expecting attach to leave the program running after stopping debug while vscode-go is killing the program. So to fix this, vscode-go needs to call the "detatch" function instead of the "halt" function on mode remote and maybe add request attach to mean leave program running after stopping debugger. |
@AlexRouSg Thanks very much, it is. As so far the only available value of "request" is "launch", and I think it'll be better to add it into the wiki. |
Sorry for getting to this a little late...
Nothing in @caibirdme's description talks about issues after stopping debug. Can you elaborate on this? |
Sorry for being vague, from reading the delve docs and source code of the plugin, I found out that the plugin was sending the "halt" command to delve which kills the program. Where if it sent the "detach" command, it would've left the program running. It's been so long since then I cannot remember where I found the relevant code/docs sorry. |
Ohh might have misunderstood what you were asking. He basically said
Which means, he wants the process to remain running after stopping the debugger. i.e. for the plugin to "detach" instead of "halt" |
Ah! I missed that, thanks. |
@ramya-rao-a , It's a problem that if I use {"request":"launch"} to start a remote debuging, everytime I stops it, it kills the process. But If I use {"request":"attach"}, it doesn't work. I hope I can attach to a remote process and detach it without killing it |
@caibirdme When you use {"request":"launch"} to start remote debugging, are you using {"mode": "remote"} as well? |
This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions. |
@ramya-rao-a Can I ask whether there is any update on this? |
@quoctruong there is an open PR for this, I will definitely get to it this month. |
This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions. |
@ramya-rao-a Yes I did |
@ramya-rao-a Any update on this issue? |
No updates at the moment |
@ramya-rao-a Is there any new update on this? I see that @BetaXOi has a PR for this fix. |
We have targeted quite a few debug related features and bug fixes for the next update that I plan to release in a few days. This issue is in track for the next set of debug related features and bug fixes that we will be targeting. Thanks for your patience! |
@ramya-rao-a @jhendrixMSFT Sorry for constantly pinging but is this issue still on track to be addressed in the next release? |
@quoctruong sorry for the delay. My hope is to have this fixed in the release for the month of March. |
@jhendrixMSFT Thanks for the update! |
@quoctruong, @iantalarico and @pongad Please feel free to review the PR #2125 for this feature |
The attach feature is now available in the latest update (0.11.0) to the Go extension. |
If you have a question, please ask it on https://gitter.im/Microsoft/vscode-go or on the VSCode channel in Gophers Slack(https://invite.slack.golangbridge.org/)
If you have issues around GOPATH, read https://github.com/Microsoft/vscode-go/wiki/GOPATH-in-the-VS-Code-Go-extension first.
If you have issues debugging your Go programs
"trace": "verbose"
and share the resulting logs in the debug consoleIf this is a bug report, please share
Steps to Reproduce:
launch.json
6. change launch.json from "request":"attach" to "request":"launch", everything wil be OK but 7. Everytime I stop the debugging, it also stop the process which is not the same as attach
The text was updated successfully, but these errors were encountered: