Class: Debugger::BreakpointsCommand

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



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

def help(cmd)
  %{
    b[reak]\tlist breakpoints
  }
end

.help_commandObject



90
91
92
# File 'lib/ruby-debug/commands/breakpoints.rb', line 90

def help_command
  'break'
end

Instance Method Details

#executeObject



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/ruby-debug/commands/breakpoints.rb', line 74

def execute
  unless Debugger.breakpoints.empty?
    print "Breakpoints:\n"
    Debugger.breakpoints.sort_by{|b| b.id }.each do |b|
      if b.expr.nil?
        print "  %d %s:%s\n", b.id, b.source, b.pos
      else
        print "  %d %s:%s if %s\n", b.id, b.source, b.pos, b.expr
      end
    end
  else
    print "No breakpoints\n"
  end
end

#regexpObject



70
71
72
# File 'lib/ruby-debug/commands/breakpoints.rb', line 70

def regexp
  /^\s*b(?:reak)?$/
end