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, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



128
129
130
131
132
# File 'lib/ruby-debug/commands/breakpoints.rb', line 128

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

.help_commandObject



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

def help_command
  'delete'
end

Instance Method Details

#executeObject



109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/ruby-debug/commands/breakpoints.rb', line 109

def execute
  pos = @match[1]
  unless pos
    if confirm("Clear all breakpoints? (y/n) ")
      Debugger.breakpoints.clear
    end
  else
    pos = pos.to_i
    unless Debugger.remove_breakpoint(pos)
      print "Breakpoint %d is not defined\n", pos
    end
  end
end

#regexpObject



105
106
107
# File 'lib/ruby-debug/commands/breakpoints.rb', line 105

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