diff options
author | Takashi Kokubun <[email protected]> | 2022-11-18 09:34:38 -0800 |
---|---|---|
committer | git <[email protected]> | 2022-11-18 17:34:42 +0000 |
commit | b1cbc883f2add06479113b61005f4cdfa90ff266 (patch) | |
tree | 6c21d94e81911b3d25387cb585c37cabe09ab026 /lib/irb.rb | |
parent | 10788166e7e568fdcd0b748e8d5dab442dcdc7ef (diff) |
[ruby/irb] Minor fixes on debug command
(https://github.com/ruby/irb/pull/447)
* Minor fixes on debug command
* Update lib/irb/cmd/debug.rb
Diffstat (limited to 'lib/irb.rb')
-rw-r--r-- | lib/irb.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 1cd89d295c..64da852157 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -393,8 +393,6 @@ module IRB end class Irb - DIR_NAME = __dir__ - ASSIGNMENT_NODE_TYPES = [ # Local, instance, global, class, constant, instance, and index assignment: # "foo = bar", @@ -436,13 +434,14 @@ module IRB @scanner = RubyLex.new end + # A hook point for `debug` command's TracePoint after :IRB_EXIT as well as its clean-up def debug_break # it means the debug command is executed - if defined?(DEBUGGER__) && DEBUGGER__.respond_to?(:original_capture_frames) + if defined?(DEBUGGER__) && DEBUGGER__.respond_to?(:capture_frames_without_irb) # after leaving this initial breakpoint, revert the capture_frames patch - DEBUGGER__.singleton_class.send(:alias_method, :capture_frames, :original_capture_frames) + DEBUGGER__.singleton_class.send(:alias_method, :capture_frames, :capture_frames_without_irb) # and remove the redundant method - DEBUGGER__.singleton_class.send(:undef_method, :original_capture_frames) + DEBUGGER__.singleton_class.send(:undef_method, :capture_frames_without_irb) end end |