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

#format_frame

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



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ruby-debug/commands/frame.rb', line 32

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

.help_commandObject



28
29
30
# File 'lib/ruby-debug/commands/frame.rb', line 28

def help_command
  %w|where frame|
end

Instance Method Details

#executeObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/ruby-debug/commands/frame.rb', line 16

def execute
  @state.context.frames.each_with_index do |frame, idx|
    if idx == @state.frame_pos
      print "--> "
    else
      print "    "
    end
    print format_frame(frame, idx)
  end
end

#regexpObject



12
13
14
# File 'lib/ruby-debug/commands/frame.rb', line 12

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