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



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

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



139
140
141
# File 'lib/ruby-debug/commands/frame.rb', line 139

def help_command
  'frame'
end

Instance Method Details

#executeObject



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

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



123
124
125
# File 'lib/ruby-debug/commands/frame.rb', line 123

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