Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exit command workaround, handle IRB_EXIT in debug_readline #923

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Apr 17, 2024

Removing workaround

Command was a method.

binding.irb # self.exit was overridden
exit # this was executing exit command. Need workaround to avoid `uncaught throw :IRB_EXIT` error

Now, it's not a method. Workaround for exit and exit! is not needed anymore.

Debug and exit

catch(:IRB_EXIT) was missing in handling debug command. It was working because the workaround was luckily triggered.
Added catch because the workaround is removed.

Behavior change

With this ruby file

binding.irb
puts 'hello'
binding.irb

In this pull request, debug exit prints 'hello' and moves to the next breakpoint, (just like CTRL-d input).
Before this change, it was exiting process without printing 'hello'.

@tompng tompng force-pushed the rm_exit_workaround branch from d522f83 to 364d5f8 Compare April 18, 2024 12:08
@st0012 st0012 added the bug Something isn't working label Apr 19, 2024
@tompng tompng merged commit 0b5dd6a into ruby:master Apr 20, 2024
30 checks passed
@tompng tompng deleted the rm_exit_workaround branch April 20, 2024 07:45
matzbot pushed a commit to ruby/ruby that referenced this pull request Apr 20, 2024
debug_readline
(ruby/irb#923)

* Remove exit and exti! command workaround when executed outside of IRB

Command was a method. It could be executed outside of IRB.
Workaround for it is no longer needed.

* Handle IRB_EXIT in debug mode

* Add exit and exit! command in rdbg mode

ruby/irb@0b5dd6afd0
artur-intech pushed a commit to artur-intech/ruby that referenced this pull request Apr 26, 2024
debug_readline
(ruby/irb#923)

* Remove exit and exti! command workaround when executed outside of IRB

Command was a method. It could be executed outside of IRB.
Workaround for it is no longer needed.

* Handle IRB_EXIT in debug mode

* Add exit and exit! command in rdbg mode

ruby/irb@0b5dd6afd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants