Class: Debugger::StepCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/stepping.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, #find, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



49
50
51
52
53
# File 'lib/ruby-debug/commands/stepping.rb', line 49

def help(cmd)
  %{
    s[tep][ nnn]\tstep (into methods) once or nnn times
  }
end

.help_commandObject



45
46
47
# File 'lib/ruby-debug/commands/stepping.rb', line 45

def help_command
  'step'
end

Instance Method Details

#executeObject



37
38
39
40
41
42
# File 'lib/ruby-debug/commands/stepping.rb', line 37

def execute
  force = @match[1] == '+'
  steps = @match[2] ? @match[2].to_i : 1
  @state.context.step(steps, force)
  @state.proceed
end

#regexpObject



33
34
35
# File 'lib/ruby-debug/commands/stepping.rb', line 33

def regexp
  /^\s*s(?:tep)?([+-])?(?:\s+(\d+))?$/
end