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



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

def self.description
  <<-EOD
    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.
  EOD
end

.regexpObject



14
15
16
# File 'lib/byebug/commands/where.rb', line 14

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

.short_descriptionObject



33
34
35
# File 'lib/byebug/commands/where.rb', line 33

def self.short_description
  'Displays the backtrace'
end

Instance Method Details

#executeObject



37
38
39
# File 'lib/byebug/commands/where.rb', line 37

def execute
  print_backtrace
end