| Class | Debugger::DeleteBreakpointCommand |
| In: |
cli/ruby-debug/commands/breakpoints.rb
|
| Parent: | Command |
Implements debugger "delete" command.
# File cli/ruby-debug/commands/breakpoints.rb, line 148
148: def help(cmd)
149: %{
150: del[ete][ nnn...]\tdelete some or all breakpoints
151: }
152: end
# File cli/ruby-debug/commands/breakpoints.rb, line 144
144: def help_command
145: 'delete'
146: end
# File cli/ruby-debug/commands/breakpoints.rb, line 122
122: def execute
123: unless @state.context
124: errmsg "We are not in a state we can delete breakpoints.\n"
125: return
126: end
127: brkpts = @match[1]
128: unless brkpts
129: if confirm("Delete all breakpoints? (y or n) ")
130: Debugger.breakpoints.clear
131: end
132: else
133: brkpts.split(/[ \t]+/).each do |pos|
134: pos = get_int(pos, "Delete", 1)
135: return unless pos
136: unless Debugger.remove_breakpoint(pos)
137: errmsg "No breakpoint number %d\n", pos
138: end
139: end
140: end
141: end