From 33ad436f72b17450f36982e2e90905883dcb2e67 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Mon, 11 Jul 2022 00:38:58 +0900 Subject: [PATCH] DAP: need to wait for connection At the breakpoint by `debugger()` method, the connection is needed and wait for the connection if it is not connected. With the fowllowing scenario, the debugger raises an exception becuase the connection is kept (but disconnection violate this assumption) 1. run the script includes `debugger` call 2. connect to DAP client 3. disconnect from DAP client 4. call `debugger` method To solve this issue, it needs to wait for the connection. `UI_ServerBase::sock` and `UI_ServerBase::readline` do it and we can use them on DAP connection, so remove `UI_DAP::sock` and `UI_DAP::readline`. --- lib/debug/server_dap.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/debug/server_dap.rb b/lib/debug/server_dap.rb index 25abec5d1..0041b9027 100644 --- a/lib/debug/server_dap.rb +++ b/lib/debug/server_dap.rb @@ -437,14 +437,6 @@ def process ## called by the SESSION thread - def readline prompt - @q_msg.pop || 'kill!' - end - - def sock skip: false - yield $stderr - end - def respond req, res send_response(req, **res) end