Missing DAP OutputEvents for debuggee stdout/stderr

Ouverte
#1,160 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
ruby
Domaine
devtools

Piste de recherche

Reproduce the issue with the linked rdbg-stdout-issue example in Zed and inspect the DAP logs while running test.rb. Read the debug gem's DAP output handling and compare it with vscode-rdbg's extension.ts around line 994. Done means stdout and stderr appear in the Debug Console as OutputEvents with stdout and stderr categories, including output after the breakpoint.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Your environment

  • ruby -v: ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [arm64-darwin25]
  • rdbg -v: rdbg 1.11.0

Describe the bug

When debugging a Ruby program with rdbg via DAP, the debuggee's stdout and stderr output is not sent as DAP OutputEvents. Instead, the output appears to be passed through to rdbg own stdout/stderr streams, which prevents it from viewing in the Debug Console of DAP clients that don't implement workarounds.

To Reproduce

The easiest way to reproduce is to debug any Ruby file with Zed (with installed Ruby extension):
I've created a small repo with an example: https://github.com/vitallium/rdbg-stdout-issue

Steps:

  1. Clone the repo
  2. Install gems with bundle install
  3. Open in Zed
  4. Open test.rb file
  5. Press F4 to start the debugging session, and in the popup choose Debug file
  6. Continue execution till the end.

According to the Debug Adapter Protocol specification, debug adapters should capture the debuggee's output streams and send them as OutputEvents with appropriate categories stdout and stderr

When a Ruby program prints to stdout/stderr, rdbg should send OutputEvent messages like:

{
  "type": "event",
  "event": "output",
  "body": {
    "category": "stdout",
    "output": "Hello from stdout\n"
  }
}

Expected behavior

The Console panel should print: Hello from stdout, Hello from stderr and After breakpoint when the execution continues. Currently, rdbg does not send these OutputEvents. The debuggee's stdout/stderr is passed through to rdbg own stdout/stderr streams, which can be seen in adapter logs but not in the Debug Console. You can check that by opening the DAP logs in Zed via the command palette dev: open debug adapter logs.

Additional context

The vscode-rdbg extension actually does that: https://github.com/ruby/vscode-rdbg/blob/master/src/extension.ts#L994

I think I can work on a fix if you consider this an issue (or a feature request) with the debug gem. Thanks!

Langage dominant
Ruby
Étoiles
1.3k
Forks
146
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ruby/debug

Toutes les issues de ruby/debug

Issues similaires

Plus d'issues Ruby

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.