Class: Debugger::WhereCommand

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

#adjust_frame, #format_frame, #get_int

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ruby-debug/commands/frame.rb', line 71

def help(cmd)
  if cmd == 'where'
    %{
      w[here]\tdisplay frames
    }
  else
    %{
      bt|backtrace\t\talias for where
    }
  end
end

.help_commandObject



67
68
69
# File 'lib/ruby-debug/commands/frame.rb', line 67

def help_command
  %w|where frame|
end

Instance Method Details

#executeObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/ruby-debug/commands/frame.rb', line 55

def execute
  (0...@state.context.stack_size).each do |idx|
    if idx == @state.frame_pos
      print "--> "
    else
      print "    "
    end
    print format_frame(idx)
  end
end

#regexpObject



51
52
53
# File 'lib/ruby-debug/commands/frame.rb', line 51

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