Debugger exceptions crash the debugger and disconnect from the client
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the protocol-server request handling in lib/debug/server_dap.rb, especially the variable-rendering code at lines 877-921, and review commit f9f3a7fee7d37749e69de5b16689636621c4fdbd. Compare the DAP and CDP server paths and determine where an injected exception can be handled centrally. Done means protocol-server exceptions produce an error response with details while the debugger remains connected.
Written by the indexing model from the issue text.
Description
Your environment
ruby -v:ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]rdbg -v:rdbg 1.8.0 {:mode=>:start, :no_color=>nil}
Describe the bug
Developing the CDP/DAP servers can be quite tedious, because any mistakes can raise exceptions that aren't caught, crash the server, and disconnect your IDE. Each time it requires restarting your debugger session.
To Reproduce
Add a raise anywhere in the protocol servers, e.g. where variables are rendered.
Expected behavior
A error response to be sent to the client, which can display a message with error details.
Instead, the exception is raised, the debug adapter crashes, and the client disconnects.
Additional context
I played around with implementing this here, and got it working for the :scope and :variables requests.
It's pretty fiddly, it looks like each when branch needs to be wrapped in a separate begin/rescue block, which is quite tedious. I wonder if there's a more central place to rescue it.
It would also need to be implemented twice, because of all this logic is duplicated between the DAP and CDP servers.
- Dominant language
- Ruby
- Stars
- 1.3k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/debug
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAP Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
betagouv/acces-cible#722 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
foobara/empty-ruby-project-generator#10 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100