You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func main() {
for i := 0; true; i++ {
fmt.Println("================== i", i)
time.Sleep(2 * time.Second)
}
}
Launch debug session with "stopOnEntry":true
Click "Continue" (F5)
Evaluate any expression via Debug Console (e.g. 2+2)
Try to pause - it will not work
Log shows:
From client: continue({"threadId":1})
ContinueRequest
To client: {"seq":0,"type":"response","request_seq":9,"command":"continue","success":true}
ContinueResponse
2020-10-09T08:27:52-07:00 debug layer=rpc (async 13) <- RPCServer.Command(api.DebuggerCommand{"name":"continue","ReturnInfoLoadConfig":null})
2020-10-09T08:27:52-07:00 debug layer=debugger continuing
================== i 0
================== i 1
================== i 2
2+2
From client: evaluate({"expression":"2+2","context":"repl"})
EvaluateRequest
2020-10-09T08:28:03-07:00 debug layer=rpc <- RPCServer.Eval(rpc2.EvalIn{"Scope":{"GoroutineID":-1,"Frame":0,"DeferredCall":0},"Expr":"2+2","Cfg":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1}}) <===== BLOCKING
================== i 3
================== i 4
From client: pause({"threadId":1})
PauseRequest
To client: {"seq":0,"type":"response","request_seq":11,"command":"pause","success":true}
PauseResponse <=============== NOT WORKING
================== i 5
================== i 6
From client: pause({"threadId":1})
PauseRequest
To client: {"seq":0,"type":"response","request_seq":12,"command":"pause","success":true}
PauseResponse <=============== NOT WORKING
From client: disconnect({"restart":false})
DisconnectRequest
HaltRequest <=============== BLOCKED
================== i 7
Killing debug process manually as we could not halt delve in time
killing debugee (pid: 32107)...
DisconnectRequest to parent
To client: {"seq":0,"type":"response","request_seq":13,"command":"disconnect","success":true}
DisconnectResponse
A call to getDebugState can be used before a call to delve is made to determine if it is running. In that case we can return an error that evaluation of expression is only supported when stopped.
The text was updated successfully, but these errors were encountered:
This has been addressed in the new dlv-dap adapter. The pause PR is still pending, but testing this with just disconnect, it is clear that delve is not blocked after getting an expression when running.
================== i 0
================== i 1
2+2
Unable to process `evaluate`: debuggee is running
================== i 2
Detaching and terminating target process
dlv dap (45444) exited with code: 0
With logging on:
8:39:22-07:00 debug layer=debugger continuing
================== i 0
================== i 1
================== i 2
2+2
2021-05-13T18:39:26-07:00 debug layer=dap [<- from client]{"seq":11,"type":"request","command":"evaluate","arguments":{"expression":"2+2","context":"repl","format":{}}}
2021-05-13T18:39:26-07:00 debug layer=dap Unable to process `evaluate`: debuggee is running
2021-05-13T18:39:26-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":11,"success":false,"command":"evaluate","message":"Unable to process `evaluate`","body":{"error":{"id":4000,"format":"Unable to process `evaluate`: debuggee is running"}}}
Unable to process `evaluate`: debuggee is running
2021-05-13T18:39:28-07:00 debug layer=dap [<- from client]{"seq":12,"type":"request","command":"disconnect","arguments":{"terminateDebuggee":true}}
2021-05-13T18:39:28-07:00 debug layer=debugger halting
2021-05-13T18:39:28-07:00 debug layer=dap "continue" command stopped - reason "manual"
2021-05-13T18:39:28-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"pause","allThreadsStopped":true}}
Detaching and terminating target process
2021-05-13T18:39:28-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Detaching and terminating target process\n","source":{}}}
2021-05-13T18:39:28-07:00 debug layer=debugger detaching
2021-05-13T18:39:28-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":12,"success":true,"command":"disconnect"}
2021-05-13T18:39:28-07:00 debug layer=dap DAP server stopping...
2021-05-13T18:39:28-07:00 debug layer=dap DAP server stopped
dlv dap (42672) exited with code: 0
Steps to reproduce:
"stopOnEntry":true
Log shows:
A call to getDebugState can be used before a call to delve is made to determine if it is running. In that case we can return an error that evaluation of expression is only supported when stopped.
The text was updated successfully, but these errors were encountered: