`-n` and `-e` cannot be used together

Ouverte
#963 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
42/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
ruby
Domaine
cli, devtools

Piste de recherche

Start with rdbg's command-line handling for -n, -e, and -c, then run the provided OpenStruct reproduction to observe the current behavior. Done means the command stops at OpenStruct#initialize and opens the attached rdbg shell without requiring continue in -e.

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

Description

enhancement

Your environment

λ ruby -v 
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22]
λ rdbg -v
rdbg 1.7.1

Describe the bug

I was trying to execute some command with -c and specify a break point using -e so that I don't need to write the script in the rdbg again.
It works but I still need to manually run continue, to avoid this, I thought -n could help. However, after some tests I turns out -n and -e cannot be used together.

My current workaround is to put continue in -e:

rdbg -c -e 'b OpenStruct#initialize'$'\n''continue' -- ruby -rostruct -e 'OpenStruct.new'

To Reproduce

rdbg -n -c -e 'b OpenStruct#initialize' -- ruby -rostruct -e 'OpenStruct.new'

Expected behavior

process won't exit and attached rdbg shell on OpenStruct#initialize, output should look like:

[122, 131] in /usr/local/Cellar/ruby/3.2.2/lib/ruby/3.2.0/ostruct.rb
   122|   #   data = OpenStruct.new(hash)
   123|   #
   124|   #   data   # => #<OpenStruct country="Australia", capital="Canberra">
   125|   #
   126|   def initialize(hash=nil)
=> 127|     if hash
   128|       update_to_values!(hash)
   129|     else
   130|       @table = {}
   131|     end
=>#0    OpenStruct#initialize(hash=nil) at /usr/local/Cellar/ruby/3.2.2/lib/ruby/3.2.0/ostruct.rb:127
  #1    [C] Class#new at -e:1
  # and 1 frames (use `bt' command for all frames)

Stop by #0  BP - Method  OpenStruct#initialize at /usr/local/Cellar/ruby/3.2.2/lib/ruby/3.2.0/ostruct.rb:126

Additional context

process exists and prints nothing.

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.