Class: Rubinius::Debugger::Command::Condition

Inherits:
Rubinius::Debugger::Command show all
Defined in:
lib/rubinius/debugger/commands.rb

Instance Method Summary collapse

Methods inherited from Rubinius::Debugger::Command

commands, #current_frame, #current_method, descriptor, ext_help, help, #initialize, #listen, match?, pattern, #run_code, #variables

Methods included from Display

#ask, #crit, #display, #error, #info, #section

Constructor Details

This class inherits a constructor from Rubinius::Debugger::Command

Instance Method Details

#run(args) ⇒ Object



685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/rubinius/debugger/commands.rb', line 685

def run(args)
  bp_id, condition = args.split(/\s+/, 2)
  bp_id = bp_id.to_i

  if @debugger.breakpoints.empty?
    error "No breakpoint set"
    return
  elsif bp_id > @debugger.breakpoints.size || bp_id < 1
    error "Invalid breakpoint number."
    return
  end

  bp = @debugger.breakpoints[bp_id - 1]
  bp.set_condition(condition)
end