Sha256: eb45c35faf2692f297ee2669400a530d95193e9ad079204b329dbf176f6cac50

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../command'

class Trepan::Command::DeleteBreakpontCommand < Trepan::Command

  unless defined?(HELP)
    NAME = File.basename(__FILE__, '.rb')
    HELP = <<-HELP
#{NAME} [bpnumber [bpnumber...]]  

Delete some breakpoints.

Arguments are breakpoint numbers with spaces in between.  To delete
all breakpoints, give no argument.  those breakpoints.  Without
argument, clear all breaks (but first ask confirmation).
    
See also the "clear" command which clears breakpoints by line/file
number.
    HELP

    CATEGORY      = 'breakpoints'
    SHORT_HELP    = 'Delete some breakpoints'
  end

  def run(args)
    if args.size == 1
      if confirm('Delete all breakpoints?', false)
        @proc.brkpts.reset
        return
      end
    end
    first = args.shift
    args.each do |num_str|
      opts = {:msg_on_error => '%s must be a number' % num_str}
      i = @proc.get_an_int(num_str, opts)
      if i 
        success = @proc.delete_breakpoint_by_number(num_str.to_i, false) if i
        msg('Deleted breakpoint %d.' % i) if success
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/delete.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/delete.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/delete.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/delete.rb