ruby/irb

Can't enter a debug session with irb 1.13

filipebarcos opened this issue · 4 comments

Description

I'm getting an error message saying I can't use debug. Seems like version 1.12 is working fine, tho.

    15:
 => 16:       binding.irb
    17:       { min: min.ceil(2), max: max.floor(2) }
    
>> debug
Debugging commands are only available when IRB is started with binding.irb
=> nil

Result of irb_info

>> irb_info
Ruby version: 3.3.1
IRB version: irb 1.13.0 (2024-05-01)
InputMethod: RelineInputMethod with Reline 0.5.4
Completion: Tab Complete, RegexpCompletor
.irbrc paths: /Users/filipe/.irbrc, /Users/filipe/src/github.com/core/.irbrc
RUBY_PLATFORM: arm64-darwin23
LC_ALL env: en_US.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

What's your terminal emulator?

Setting Files

Are you using ~/.irbrc and ~/.inputrc?

Thanks for reporting. Can you help me collect more info with these steps:

  1. After seeing the message, run IRB::Command::Debug::BINDING_IRB_FRAME_REGEXPS and save the output
  2. And then also run caller and save the output (you can substitute sensitive info like repo names...etc.)
  3. Post the output here

With this file

require 'irb'
binding.irb

IRB can't enter debug mode.

Looks like the order of loading irb/command/debug.rb and defining Binding#irb in irb.rb is changed in irb-0.13.0

@st0012

[/\A<internal:prelude>:\d+:in (`|'Binding#)irb'\z/, /\A<internal:prelude>:\d+:in (`|'Binding#)irb'\z/]
["/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb/workspace.rb:121:in `eval'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb/workspace.rb:121:in `evaluate'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb/context.rb:624:in `evaluate_expression'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb/context.rb:595:in `evaluate'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1043:in `block (2 levels) in eval_input'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1374:in `signal_status'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1035:in `block in eval_input'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1114:in `block in each_top_level_statement'",
 "<internal:kernel>:187:in `loop'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1111:in `each_top_level_statement'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1034:in `eval_input'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1015:in `block in run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1014:in `catch'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1014:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/irb-1.13.0/lib/irb.rb:1598:in `irb'",
 "/Users/filipe/src/github.com/core/app/models/denomination_set.rb:8:in `to_skus'",
 "/Users/filipe/src/github.com/core/spec/models/denomination_set_spec.rb:7:in `block (3 levels) in <top (required)>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:263:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:263:in `block in run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:486:in `block in run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:626:in `block in run_around_example_hooks_for'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:352:in `call'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-rails-6.1.2/lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:390:in `execute_with'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:352:in `call'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/buildkite-test_collector-2.6.0/lib/buildkite/test_collector/library_hooks/rspec.rb:26:in `block (2 levels) in <main>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:390:in `execute_with'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:352:in `call'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/webmock-3.23.0/lib/webmock/rspec.rb:39:in `block (2 levels) in <main>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:457:in `instance_exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:390:in `execute_with'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:352:in `call'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:629:in `run_around_example_hooks_for'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb:486:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:468:in `with_around_example_hooks'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:259:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:646:in `block in run_examples'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:642:in `map'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:642:in `run_examples'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:607:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:608:in `block in run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:608:in `map'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb:608:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:121:in `map'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/configuration.rb:2091:in `with_suite_hooks'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:116:in `block in run_specs'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/reporter.rb:74:in `report'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:115:in `run_specs'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:89:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:71:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb:45:in `invoke'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.0/exe/rspec:4:in `<top (required)>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/bin/rspec:25:in `load'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/bin/rspec:25:in `<top (required)>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `load'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `kernel_load'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:23:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:451:in `exec'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:34:in `dispatch'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/cli.rb:28:in `start'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:28:in `block in <top (required)>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bundler-2.5.9/exe/bundle:20:in `<top (required)>'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/bin/bundle:25:in `load'",
 "/Users/filipe/.config/local/share/mise/installs/ruby/3.3.1/bin/bundle:25:in `<main>'"]

Thank you!