Class: Debugger::DeleteBreakpointCommand
- Inherits:
-
Command
- Object
- Command
- Debugger::DeleteBreakpointCommand
show all
- Defined in:
- lib/ruby-debug/commands/breakpoints.rb
Overview
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
Class Method Details
.help(cmd) ⇒ Object
129
130
131
132
133
|
# File 'lib/ruby-debug/commands/breakpoints.rb', line 129
def help(cmd)
%{
del[ete][ nnn]\tdelete some or all breakpoints
}
end
|
.help_command ⇒ Object
125
126
127
|
# File 'lib/ruby-debug/commands/breakpoints.rb', line 125
def help_command
'delete'
end
|
Instance Method Details
#execute ⇒ Object
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# File 'lib/ruby-debug/commands/breakpoints.rb', line 110
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
|
#regexp ⇒ Object
106
107
108
|
# File 'lib/ruby-debug/commands/breakpoints.rb', line 106
def regexp
/^\s*del(?:ete)?(?:\s+(\d+))?$/
end
|