Debugger exceptions crash the debugger and disconnect from the client

Aperta
#1,006 1 commento 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Ruby
Stelle
1.3k
Fork
146
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ruby/debug

Tutte le issue di ruby/debug

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.