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

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



141
142
143
144
145
146
147
148
149
150
# File 'lib/ruby-debug/commands/frame.rb', line 141

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



137
138
139
# File 'lib/ruby-debug/commands/frame.rb', line 137

def help_command
  'frame'
end

Instance Method Details

#executeObject



125
126
127
128
129
130
131
132
133
134
# File 'lib/ruby-debug/commands/frame.rb', line 125

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



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

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