Sha256: 4b5782bfda8ba02d89e6e0925e07fbd111973144d7ed51cccfa6c7f35f8cfe4a

Contents?: true

Size: 920 Bytes

Versions: 10

Compression:

Stored size: 920 Bytes

Contents

module Debugger
  class CatchCommand < Command # :nodoc:
    self.control = true

    def regexp
      /^\s* cat(?:ch)? (?:\s+(.+))? $/x
    end

    def execute
      exception_class_name = @match[1]
      unless exception_class_name
        errmsg "Exception class must be specified for 'catch' command"
      else
        binding = @state.context ? get_binding : TOPLEVEL_BINDING
        unless debug_eval("#{exception_class_name}.is_a?(Class)", binding)
          print_msg "Warning #{exception_class_name} is not known to be a Class"
        end
        Debugger.add_catchpoint(exception_class_name)
        print_catchpoint_set(exception_class_name)
      end
    end
    
    class << self
      def help_command
        'catch'
      end

      def help(cmd)
        %{
          cat[ch]\t\t\tshow catchpoint
          cat[ch] <an Exception>\tset catchpoint to an exception
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-debug-ide-0.3.3 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.4.3 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.3.1 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.4.4 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.3.2 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.4.0 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.4.1 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.4.2 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.3.0 lib/ruby-debug/commands/catchpoint.rb
ruby-debug-ide-0.3.4 lib/ruby-debug/commands/catchpoint.rb