Class: Byebug::FrameCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/frame.rb

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/byebug/commands/frame.rb', line 233

def description
  %{f[rame][ frame-number]

    Move the current frame to the specified frame number, or the 0 if no
    frame-number has been given.

    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.

    Without an argument, the command prints the current stack frame. Since
    the current position is redisplayed, it may trigger a resyncronization
    if there is a front end also watching over things.}
end

.namesObject



229
230
231
# File 'lib/byebug/commands/frame.rb', line 229

def names
  %w(frame)
end

Instance Method Details

#executeObject



222
223
224
225
226
# File 'lib/byebug/commands/frame.rb', line 222

def execute
  return print_frame @state.frame_pos unless @match[1]
  return unless pos = get_int(@match[1], "Frame")
  adjust_frame(pos, true)
end

#regexpObject



218
219
220
# File 'lib/byebug/commands/frame.rb', line 218

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