-
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: communicate clearly when setting breakpoint fails #1840
Comments
One issue with making the breakpoint failures more obvious is that users with dual debugging there may be many breakpoints that will fail since VS Code sends breakpoints to all active debug sessions (see #1648 (comment)). Since function breakpoints are user provided text, I agree that for these it might be useful to provide some notification that it was not set. |
vscode UI has a clear marking system for breakpoints. Red if it was successfully set. Grey if it failed. And you can mouse over for the reason. These markers show up both in the side bar and in the code. That's why StopOnEntry is useful. It gives you a chance to validate your breakpoints. |
Also, since we already communicate this with an ErrorResponse, we could turn on showUser to have it generate a visible pop-up. |
@polinasok VS Code UI doesn't show the reasons once the session ends and there is no session. In addition, as @suzmue pointed out, error is not the right action in this case when there are multiple sessions. |
Sorry, never mind, we don't send error responses. We send a success response with the error messages in it. And in all other cases, where we were not happy with standard UI features, we went for OutputEvents. |
I do worry that output events get buried amidst everything else (program's output, stderr, logging, etc). Should we intercept the ones sent to stderr as well as ErrorResponses in the thin adapter and also dump all problems to a separate Output tab? Those will survive after the session. |
Most users don't enable logging. Separate Output tab - we already know Go Debug output tab is already hard to discover (and I hope to minimize use of it if possible). :-) Nice thing about Debug Console is there is a dedicated separate console for each debug session. |
I was thinking that problems could be logged to an Output tab always. No logging controls needed. Unless there is a way to put this in the PROBLEMS tab. Even though there is a dedicated Debug Console per session, the breakpoints from all files will be sent everywhere, so errors will go to all instances :( |
I'd say showing what breakpoints are effective or not for each session is a good thing. Once the |
We can start with function breakpoints at least - which is easy to misconfigure and needs feedback. |
Yes, we can. |
Change https://golang.org/cl/366915 mentions this issue: |
They are all fixed in the latest dlv version. Updates #1676 Updates #123 Updates #855 Updates #1840 Change-Id: I6014a1382396865a1921eb6c92e1ccccdea556de Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/366915 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Polina Sokolova <polina@google.com>
Thinking it again, the current breakpoint UI that highlights only effective breakpoints is sufficient. Additional popup or console message will interfere the workflows of already established users more. I hope people find the hint and the verification procedure from the FAQ entry. Closing. |
$ dlv-dap version -v
``` Delve Debugger Version: 1.7.2 Build:What did I do
println
orinit
.What did I expect
Either program stops in functions where the names match one of the function breakpoints I set, or if they can't be set, see output message.
What did I see instead
Program runs without being stopped.
In fact,
dlv
returned information about the failed breakpoint setting as a response ofsetBreakpointRequests
.These are meant to be used to populate the BREAKPOINTS viewlet and hover message. However, unfortunately, since the program continued and eventually the debug session ended, users wouldn't know that unless the program is stopped at other (successfully configured) breakpoints or paused for other reasons.
@suzmue @polinasok What do you think about generating Output events (
console
) to make it more visible?Full log
``` Starting: /Users/hakim/go/bin/dlv-dap dap --check-go-version=false --listen=127.0.0.1:58566 --log=true --log-output=dap,debugger --log-dest=3 from /Users/hakim/report/b DAP server listening at: 127.0.0.1:58566 2021-10-14T09:10:41-04:00 debug layer=dap DAP server pid = 7778 2021-10-14T09:10:41-04:00 debug layer=dap DAP connection started 2021-10-14T09:10:41-04:00 debug layer=dap [<- from client]{"seq":1,"type":"request","command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"go","locale":"en-us","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path","supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsProgressReporting":true,"supportsInvalidatedEvent":true}} 2021-10-14T09:10:41-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":true,"supportsConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsDelayedStackTraceLoading":true,"supportsLogPoints":true,"supportsClipboardContext":true,"supportsSteppingGranularity":true,"supportsInstructionBreakpoints":true}} 2021-10-14T09:10:41-04:00 debug layer=dap [<- from client]{"seq":2,"type":"request","command":"launch","arguments":{"name":"Launch Package","type":"go","request":"launch","mode":"debug","program":".","stopOnEntry":false,"logOutput":"dap,debugger","showLog":true,"__configurationTarget":5,"packagePathToGoModPathMap":{"/Users/hakim/report/b":"/Users/hakim/report/b","/Users/hakim/report/a":"/Users/hakim/report/a","/Users/hakim/sdk/gotip/src/runtime":"/Users/hakim/sdk/gotip/src"},"debugAdapter":"dlv-dap","apiVersion":2,"dlvLoadConfig":{"followPointers":true,"maxVariableRecurse":1,"maxStringLen":64,"maxArrayValues":64,"maxStructFields":-1},"showGlobalVariables":false,"substitutePath":[],"dlvToolPath":"/Users/hakim/go/bin/dlv-dap","env":{},"__buildDir":"/Users/hakim/report/b","__sessionId":"cf62686b-8a6d-4693-a0da-30bf2fed7d03"}} 2021-10-14T09:10:41-04:00 debug layer=dap parsed launch config: { "mode": "debug", "program": ".", "backend": "default", "stackTraceDepth": 50 } 2021-10-14T09:10:42-04:00 debug layer=dap building from "/Users/hakim/report/b": [go build -o /var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/__debug_bin2601615257 -gcflags all=-N -l .] 2021-10-14T09:10:42-04:00 debug layer=dap launching binary '/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/__debug_bin2601615257' with config: { "mode": "debug", "program": "/Users/hakim/report/b", "cwd": "/Users/hakim/report/b", "output": "/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/__debug_bin2601615257", "dlvCwd": "/Users/hakim/report/b", "backend": "default", "stackTraceDepth": 50 } 2021-10-14T09:10:42-04:00 info layer=debugger launching process with args: [/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/__debug_bin2601615257] 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"initialized"} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":2,"success":true,"command":"launch"} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":3,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"main.go","path":"/Users/hakim/report/a/main.go"},"breakpoints":[{"line":24}],"lines":[24]}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"verified":false,"message":"could not find file /Users/hakim/report/a/main.go","source":{}}]}} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":4,"type":"request","command":"setFunctionBreakpoints","arguments":{"breakpoints":[{"name":"println"},{"name":"init"}]}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[{"verified":false,"message":"location \"println\" not found","source":{}},{"verified":false,"message":"Location \"init\" ambiguous: runtime.(*itab).init, runtime.(*mcentral).init, runtime.(*fixalloc).init, runtime.(*gcControllerState).init, runtime.(*gcWork).init…","source":{}}]}} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":5,"type":"request","command":"setInstructionBreakpoints","arguments":{"breakpoints":[]}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":5,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":6,"type":"request","command":"configurationDone","arguments":{}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":6,"success":true,"command":"configurationDone"} 2021-10-14T09:10:43-04:00 debug layer=debugger continuing foo bar main 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"terminated","body":{}} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":7,"type":"request","command":"threads"} 2021-10-14T09:10:43-04:00 debug layer=dap Process 7794 has exited with status 0 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"Dummy"}]}} 2021-10-14T09:10:43-04:00 debug layer=dap [<- from client]{"seq":8,"type":"request","command":"disconnect","arguments":{}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Process 7794 has exited with status 0\n","source":{}}} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Detaching\n","source":{}}} 2021-10-14T09:10:43-04:00 debug layer=debugger detaching 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":8,"success":true,"command":"disconnect"} 2021-10-14T09:10:43-04:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"terminated","body":{}} 2021-10-14T09:10:43-04:00 debug layer=dap DAP server stopping...The text was updated successfully, but these errors were encountered: