Skip to content

Remove exit command workaround, handle IRB_EXIT in debug_readline - #923

Merged
tompng merged 3 commits into
ruby:masterfrom
tompng:rm_exit_workaround
Apr 20, 2024
Merged

tompng merged 3 commits into
ruby:masterfrom
tompng:rm_exit_workaround

Conversation

@tompng

@tompng tompng commented Apr 17, 2024

Copy link
Copy Markdown
Member

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
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants