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

Aperta
#963 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

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.

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

Descrizione

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.

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.