diff options
| author | Stan Lo <stan001212@gmail.com> | 2023-08-29 13:54:21 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-08-29 12:54:25 +0000 |
| commit | 6ed1a504d49af09aac543ef39facaa11639add7e (patch) | |
| tree | 4422c7c096e2e2ade700da5dc9bee3e7ea85fdaf /lib | |
| parent | 0cfb7796928f16f967fcf7b4d0a49fab6774001f (diff) | |
[ruby/irb] irb:rdbg cleanups (https://github.com/ruby/irb/pull/697)
* Remove unused method and constant from IRB::Debug
* Update comments
https://github.com/ruby/irb/commit/98914a963c
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/irb.rb | 7 | ||||
| -rw-r--r-- | lib/irb/debug.rb | 12 |
2 files changed, 3 insertions, 16 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index db0aed055e..44477b487f 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -439,9 +439,9 @@ module IRB @scanner = RubyLex.new(@context) end - # A hook point for `debug` command's TracePoint after :IRB_EXIT as well as its clean-up + # A hook point for `debug` command's breakpoint after :IRB_EXIT as well as its clean-up def debug_break - # it means the debug command is executed + # it means the debug integration has been activated 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, :capture_frames_without_irb) @@ -547,14 +547,13 @@ module IRB each_top_level_statement do |statement, line_no| signal_status(:IN_EVAL) do begin - # If the integration with debugger is activated, we need to handle certain input differently + # If the integration with debugger is activated, we return certain input if it should be dealt with by debugger if @context.with_debugger && statement.should_be_handled_by_debugger? return statement.code end @context.evaluate(statement.evaluable_code, line_no) - # Don't echo if the line ends with a semicolon if @context.echo? && !statement.suppresses_echo? if statement.is_assignment? if @context.echo_on_assignment? diff --git a/lib/irb/debug.rb b/lib/irb/debug.rb index f722822993..f819f850b1 100644 --- a/lib/irb/debug.rb +++ b/lib/irb/debug.rb @@ -2,10 +2,6 @@ module IRB module Debug - BINDING_IRB_FRAME_REGEXPS = [ - '<internal:prelude>', - binding.method(:irb).source_location.first, - ].map { |file| /\A#{Regexp.escape(file)}:\d+:in `irb'\z/ } IRB_DIR = File.expand_path('..', __dir__) class << self @@ -76,14 +72,6 @@ module IRB irb.context.irb_name += ":rdbg" end - def binding_irb? - caller.any? do |frame| - BINDING_IRB_FRAME_REGEXPS.any? do |regexp| - frame.match?(regexp) - end - end - end - module SkipPathHelperForIRB def skip_internal_path?(path) # The latter can be removed once https://github.com/ruby/debug/issues/866 is resolved |
