Class: Debugger::DownCommand

Inherits:
Command
  • Object
show all
Includes:
FrameFunctions
Defined in:
lib/ruby-debug/commands/frame.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FrameFunctions

#format_frame

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



119
120
121
122
123
# File 'lib/ruby-debug/commands/frame.rb', line 119

def help(cmd)
  %{
    down[ nn]\tmove to lower frame
  }
end

.help_commandObject



115
116
117
# File 'lib/ruby-debug/commands/frame.rb', line 115

def help_command
  'down'
end

Instance Method Details

#executeObject



102
103
104
105
106
107
108
109
110
111
112
# File 'lib/ruby-debug/commands/frame.rb', line 102

def execute
  @state.previous_line = nil
  @state.frame_pos -= @match[1] ? @match[1].to_i : 1
  if @state.frame_pos < 0
    @state.frame_pos = 0
    print "At stack bottom\n"
  end
  frame = @state.frames[@state.frame_pos]
  @state.binding, @state.file, @state.line = frame.binding, frame.file, frame.line
  print format_frame(frame, @state.frame_pos)
end

#regexpObject



98
99
100
# File 'lib/ruby-debug/commands/frame.rb', line 98

def regexp
  /^\s*down(?:\s+(\d+))?$/
end