Class: Debugger::FrameCommand

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

#adjust_frame, #format_frame, #get_int

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



167
168
169
170
171
172
173
174
175
176
# File 'lib/ruby-debug/commands/frame.rb', line 167

def help(cmd)
  %{
    f[rame] frame-number
    Move the current frame to the specified frame number.

    A negative number indicates position from the other end.  So
    'frame -1' moves to the oldest frame, and 'frame 0' moves to
    the newest frame.
  }
end

.help_commandObject



163
164
165
# File 'lib/ruby-debug/commands/frame.rb', line 163

def help_command
  'frame'
end

Instance Method Details

#executeObject



151
152
153
154
155
156
157
158
159
160
# File 'lib/ruby-debug/commands/frame.rb', line 151

def execute
  if not @match[1]
    print "Missing a frame number argument.\n"
    return
  else
    pos = get_int(@match[1], "Frame")
    return unless pos
  end
  adjust_frame(pos, true)
end

#regexpObject



147
148
149
# File 'lib/ruby-debug/commands/frame.rb', line 147

def regexp
  /^\s* f(?:rame)? (?:\s+ (.*))? \s*$/x
end