Class: Byebug::StepCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/stepping.rb

Overview

Implements the step functionality.

Allows the user the continue execution until the next instruction, possibily in a different frame. Use step to step into method calls or blocks.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



80
81
82
83
84
85
86
# File 'lib/byebug/commands/stepping.rb', line 80

def description
  %{s[tep][+-]?[ nnn]

    Steps (into methods) once or nnn times.
      '+' forces to move to another line.
      '-' is the opposite of '+' and disables the :forcestep setting.}
end

.namesObject



76
77
78
# File 'lib/byebug/commands/stepping.rb', line 76

def names
  %w(step)
end

Instance Method Details

#executeObject



67
68
69
70
71
72
73
# File 'lib/byebug/commands/stepping.rb', line 67

def execute
  steps, err = parse_steps(@match[2], 'Steps')
  return errmsg(err) unless steps

  @state.context.step_into(steps, parse_force(@match[1]))
  @state.proceed
end

#regexpObject



63
64
65
# File 'lib/byebug/commands/stepping.rb', line 63

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