Class: Byebug::UpCommand

Inherits:
Command show all
Includes:
Helpers::FrameHelper, Helpers::ParseHelper
Defined in:
lib/byebug/commands/up.rb

Overview

Move the current frame up in the backtrace.

Instance Attribute Summary

Attributes inherited from Command

#processor

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::ParseHelper

#get_int, #parse_steps, #syntax_valid?

Methods included from Helpers::FrameHelper

#jump_frames, #switch_to_frame

Methods inherited from Command

#arguments, columnize, #context, #frame, help, #initialize, match, to_s

Methods included from Helpers::StringHelper

#camelize, #prettify

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



20
21
22
23
24
25
26
27
28
# File 'lib/byebug/commands/up.rb', line 20

def self.description
  <<-EOD
    up[ count]

    #{short_description}

    Use the "bt" command to find out where you want to go.
  EOD
end

.regexpObject



16
17
18
# File 'lib/byebug/commands/up.rb', line 16

def self.regexp
  /^\s* up (?:\s+(\S+))? \s*$/x
end

.short_descriptionObject



30
31
32
# File 'lib/byebug/commands/up.rb', line 30

def self.short_description
  'Moves to a higher frame in the stack trace'
end

Instance Method Details

#executeObject



34
35
36
37
38
39
40
41
# File 'lib/byebug/commands/up.rb', line 34

def execute
  pos, err = parse_steps(@match[1], 'Up')
  return errmsg(err) unless pos

  jump_frames(pos)

  ListCommand.new(processor).execute if Setting[:autolist]
end