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
{{ message }}
Repository navigation
Terminated Event is not fired before disconnect #523
Describe the bug
It looks like in Remote Debug mode (DAP client nvim-dap) after the last program step, the debugger disconnects but doesn't fire 'Terminated Event'. In such situation, DAP client doesn't know the debugging of the debuggee has terminated and keeps the debug session alive forever. Thus requiring manual treatment.
To Reproduce
Start a debugger with rdbg --open --port 38698 target.rb in a terminal
Attach to the adapter with nvim-dap
Continue or step over till the very end of the program.
The TL;DR version is that if the debugger process runs to completion, the debug adapter must send a terminated event. If the client sends a disconnect request before the debugger process finishes, the debug adapters behavior depends on whether a launch/attach configuration was used and on the (optional) terminateDebugee flag of the request.
Activity
Reset session on tcp disconnect
ko1 commentedon Mar 25, 2022
mfussenegger/nvim-dap#436 solves the issue?
It's a bit tough to observe the debuggee's liveness (because the debugger runs in same process).
But not impossible.
If it should be supported, I'll work it.
mfussenegger commentedon Mar 25, 2022
The discussion in mfussenegger/nvim-dap#469 and the change that resulted out of the conversion (mfussenegger/nvim-dap#481) may be relevant to this as well.
The TL;DR version is that if the debugger process runs to completion, the debug adapter must send a terminated event. If the client sends a disconnect request before the debugger process finishes, the debug adapters behavior depends on whether a launch/attach configuration was used and on the (optional)
terminateDebugeeflag of the request.ko1 commentedon Mar 25, 2022
Could you give me a reference?
st0012 commentedon Mar 25, 2022
I think he refers to the
Debug session endpart of https://microsoft.github.io/debug-adapter-protocol/overview? (bottom)ko1 commentedon Mar 28, 2022
Thank you.
I agree it should be, but not sure when the connection was lost accidentally.
send `terminated` event when exit
send `terminated` event when exit