Class: Debugger::DeleteBreakpointCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/breakpoints.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



122
123
124
125
126
# File 'lib/ruby-debug/commands/breakpoints.rb', line 122

def help(cmd)
  %{
    del[ete][ nnn...]\tdelete some or all breakpoints
  }
end

.help_commandObject



118
119
120
# File 'lib/ruby-debug/commands/breakpoints.rb', line 118

def help_command
  'delete'
end

Instance Method Details

#executeObject



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/ruby-debug/commands/breakpoints.rb', line 99

def execute
  brkpts = @match[1]
  unless brkpts
      Debugger.breakpoints.clear
  else
    brkpts.split(/[ \t]+/).each do |pos|
      pos = get_int(pos, "Delete", 1)
      return unless pos
      b = Debugger.remove_breakpoint(pos)
      if b
        print_breakpoint_deleted b
      else
        print_error "No breakpoint number %d\n", pos
      end
    end
  end
end

#regexpObject



95
96
97
# File 'lib/ruby-debug/commands/breakpoints.rb', line 95

def regexp
  /^\s*del(?:ete)?(?:\s+(.*))?$/
end