Debugger exceptions crash the debugger and disconnect from the client

Abierto
#1,006 1 comentario 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Ruby
Estrellas
1.3k
Forks
146
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby/debug

Todos los issues de ruby/debug

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.