Class: Byebug::WhereCommand

Inherits:
Command
  • Object
show all
Includes:
Helpers::FrameHelper
Defined in:
lib/byebug/commands/where.rb

Overview

Show current backtrace.

Instance Attribute Summary

Attributes inherited from Command

#processor

Class Method Summary collapse

Instance Method Summary collapse

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

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/byebug/commands/where.rb', line 20

def self.description
  <<-DESCRIPTION
    w[here]|bt|backtrace

    #{short_description}

    Print the entire stack frame. Each frame is numbered; the most recent
    frame is 0. A frame number can be referred to in the "frame" command.
    "up" and "down" add or subtract respectively to frame numbers shown.
    The position of the current frame is marked with -->. C-frames hang
    from their most immediate Ruby frame to indicate that they are not
    navigable.
  DESCRIPTION
end

.regexpObject



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

def self.regexp
  /^\s* (?:w(?:here)?|bt|backtrace) \s*$/x
end

.short_descriptionObject



35
36
37
# File 'lib/byebug/commands/where.rb', line 35

def self.short_description
  "Displays the backtrace"
end

Instance Method Details

#executeObject



39
40
41
# File 'lib/byebug/commands/where.rb', line 39

def execute
  print_backtrace
end