From 252398d5cd1c6b546b717445715e24ecda60724f Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Sun, 10 Jul 2022 04:24:51 +0900 Subject: [PATCH] DAP: disable all BPs on disconnected DAP set breakpoints and on the disconnected timing they should be removed, otherwise debugger try to send DAP request and fail it because connection is already closed. --- lib/debug/server_dap.rb | 1 + lib/debug/session.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/debug/server_dap.rb b/lib/debug/server_dap.rb index 6000ede45..25abec5d1 100644 --- a/lib/debug/server_dap.rb +++ b/lib/debug/server_dap.rb @@ -361,6 +361,7 @@ def process end end + SESSION.clear_all_breakpoints send_response req ## control diff --git a/lib/debug/session.rb b/lib/debug/session.rb index f60899751..e3126b753 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -1386,6 +1386,10 @@ def clear_catch_breakpoints *exception_names end end + def clear_all_breakpoints + clear_breakpoints{true} + end + def add_iseq_breakpoint iseq, **kw bp = ISeqBreakpoint.new(iseq, [:line], **kw) add_bp bp