class Rubinius::Debugger::Command::ShowInfo

Public Instance Methods

run(args) click to toggle source
# File lib/rubinius/debugger/commands.rb, line 549
def run(args)
  if args
    case args.strip
    when "break", "breakpoints", "bp"
      section "Breakpoints"
      if @debugger.breakpoints.empty?
        info "No breakpoints set"
      end

      @debugger.breakpoints.each_with_index do |bp, i|
        if bp
          info "%3d: %s" % [i+1, bp.describe]
          if bp.has_commands?
            info "     #{bp.commands}"
          end
          if bp.has_condition?
            info "     stop only if #{bp.condition}"
          end
        end
      end
    else
      error "Unknown info: '#{args}'"
    end
  else
    error "No info subcommand"
  end
end