vscode-rdbg
vscode-rdbg copied to clipboard
Support to attach multiple sockets
For https://github.com/ruby/vscode-rdbg/issues/372
- Introduce a new adapter
MultiSessionDebugAdapter
where it emits events with all socket paths - Add a listener that subscribes to custom events that
MultiSessionDebugAdapter
emits, which attach it as a child process - This is enabled via
supportAttachMultiSockets
config
Screenshot
When running a rails server with 4 processes
Before | After |
---|---|
when set tofalse , it defaults to the picker selector |
when set to true , it attaches all as child processes |
@ikhsan
Thank you for your work! Sorry, I'm not familiar with multiple process debugging. Can you please give me the sample project to experiment the behavior?
@ono-max sure thing. I've created the demo app here: https://github.com/ikhsan/attach-multi-socket
Sorry, I'm not familiar with multiple process debugging.
The setup for multi process is here: https://github.com/ikhsan/attach-multi-socket/commit/7e65b1d57e27fa37d2c389a213886cb5824844a4. This is copied from our original app.
Steps
- Copy and run the demo app,
$ bundle install
then$ bin/rails s
- Run the extension with this branch, open the demo app
- Without multi attach
- Attach the app by clicking "Attach with rdbg"
- The picker is shown (e.g. we need to pick one by one, bad dev experience)
- The picker is shown (e.g. we need to pick one by one, bad dev experience)
- Attach the app by clicking "Attach with rdbg"
- With turning multi-attach
- Enable the flag https://github.com/ikhsan/attach-multi-socket/blob/7e65b1d57e27fa37d2c389a213886cb5824844a4/.vscode/launch.json#L12-L13
- Attach the app again by re-clicking "Attach with rdbg"
- All process are automatically attached
- All process are automatically attached
- Turn the breakpoint on the endpoint https://github.com/ikhsan/attach-multi-socket/blob/7e65b1d57e27fa37d2c389a213886cb5824844a4/app/controllers/debug_controller.rb#L3
- Visit http://localhost:3000/debug/
- Stopped at the breakpoint as normal
- Stopped at the breakpoint as normal
Let me know if the demo does or doesn't work 🙏
Thank you for your work! Sorry, I'm not familiar with multiple process debugging. Can you please give me the sample project to experiment the behavior?
Hey @ono-max 👋 just want to touch point with you on this. Did you have the chance to try debugging with the demo app?