Sha256: 20f5de0ea4893f14fd7e9936dbf16f40f68a82777dc375cd4340f04b31ef434b

Contents?: true

Size: 1.13 KB

Versions: 27

Compression:

Stored size: 1.13 KB

Contents

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

    def regexp
      /^\s* cat(?:ch)? 
           (?:\s+ (\S+))? 
           (?:\s+ (off))? \s* $/ix
    end

    def execute
      excn = @match[1] 
      if not excn
        # No args given.
        errmsg "Exception class must be specified for 'catch' command"
      elsif not @match[2]
        # One arg given.
        if 'off' == excn
          Debugger.catchpoints.clear
        else
          Debugger.add_catchpoint(excn)
          print_catchpoint_set(excn)
        end
      elsif @match[2] != 'off'
        errmsg "Off expected. Got %s\n", @match[2]
      elsif Debugger.catchpoints.member?(excn)
        Debugger.catchpoints.delete(excn)
        print_catchpoint_set(excn)
        #print "Catch for exception %s removed.\n", excn
      else
        errmsg "Catch for exception %s not found.\n", excn
      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

27 entries across 27 versions & 1 rubygems

Version Path
ruby-debug-ide-0.4.33 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.32 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.31 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.30 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.29 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.28 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.27 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.26 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.25 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.24 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.24.beta5 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.24.beta4 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta11 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta10 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta9 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta8 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta7 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.23.beta1 lib/ruby-debug-ide/commands/catchpoint.rb
ruby-debug-ide-0.4.22 lib/ruby-debug-ide/commands/catchpoint.rb