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, #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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



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

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



145
146
147
# File 'lib/ruby-debug/commands/frame.rb', line 145

def help_command
  'frame'
end

Instance Method Details

#executeObject



133
134
135
136
137
138
139
140
141
142
# File 'lib/ruby-debug/commands/frame.rb', line 133

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



129
130
131
# File 'lib/ruby-debug/commands/frame.rb', line 129

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