Uh oh!
There was an error while loading. Please reload this page.
Don't stop at DAP's connection - #640
Conversation
Without this, attaching to a ruby/debug remote session causes the debugger to pause at locations which were not intended by the user. (e.g. rspec internals when debugging a spec, when attaching to a spec which just started to run) This is due to a bug (or weird intended behaviour) in ruby/debug, which is fixed in ruby/debug#640
I found two lines comment outs are needed to "non-stop" with VSCode attach mode. diff --git a/lib/debug/server.rb b/lib/debug/server.rb
index 9abb187..abd3752 100644
--- a/lib/debug/server.rb+++ b/lib/debug/server.rb@@ -68,7 +68,7 @@ module DEBUGGER__
} unless already_connected
setup_interrupt do
- pause unless already_connected+ # pause unless already_connected
process
end
diff --git a/lib/debug/server_dap.rb b/lib/debug/server_dap.rb
index 84f954d..0842784 100644
--- a/lib/debug/server_dap.rb+++ b/lib/debug/server_dap.rb@@ -256,7 +256,7 @@ module DEBUGGER__
UI_DAP.local_fs_map_set req.dig('arguments', 'localfs') || req.dig('arguments', 'localfsMap')
when 'attach'
send_response req
- Process.kill(UI_ServerBase::TRAP_SIGNAL, Process.pid)+ # Process.kill(UI_ServerBase::TRAP_SIGNAL, Process.pid)
@is_attach = true
UI_DAP.local_fs_map_set req.dig('arguments', 'localfs') || req.dig('arguments', 'localfsMap')
when 'setBreakpoints' |
st0012
commented
Jul 6, 2022
@ko1 Yes, thanks for catching it. I've updated the |
I think the current code works: DAP connection will not stop at connection, but CUI connection will still stop. To reproduce:
With Stop (master) Without Stop (this branch) It looks like without the initial stop, this Line 318 in 49ac0a1 |
st0012
commented
Jul 7, 2022
Ah it's because commands will only be processed when suspended. |
1. Detach raw test does exactly the same thing as the request test. So it's obsolete and doesn't need to be updated. 2. The current DAP assert_reattach helper assumes the debuggee will be suspended due to the attaching stop. But it's actually not the case anymore so we need to manually pause it to make sure it can take later commands.
ko1
commented
Jul 8, 2022
fixed by #688 |
Based on the discussion in #629, DAP's connection stoppage can be removed.
Closes#629