Class: Debugger::FrameCommand

Inherits:
Command
  • Object
show all
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 inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/ruby-debug/commands/frame.rb', line 251

def help(cmd)
  %{
    f[rame] [frame-number [thread thread-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.

    If a thread number is given then we set the context for evaluating
    expressions to that frame of that thread.
  }
end

.help_commandObject



247
248
249
# File 'lib/ruby-debug/commands/frame.rb', line 247

def help_command
  'frame'
end

Instance Method Details

#executeObject



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/ruby-debug/commands/frame.rb', line 227

def execute
  if not @match[1]
    pos = 0
  else
    pos = get_int(@match[1], "Frame")
    return unless pos
  end
  if @match[2]
    context = parse_thread_num('frame', @match[2])
    unless context
      errmsg "Thread #{@match[2]} doesn't exist.\n"
      return
    end
  else
    context = @state.context
  end
  adjust_frame(pos, true, context)
end

#regexpObject



219
220
221
222
223
224
225
# File 'lib/ruby-debug/commands/frame.rb', line 219

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