class Debugger::WhereCommand

Implements debugger "where" or "backtrace" command.

Public Class Methods

help(cmd) click to toggle source
# File cli/ruby-debug/commands/frame.rb, line 180
      def help(cmd)
        s = if cmd == 'where'
          %Q{
            w[here]\tdisplay stack frames
            }
            else
          %Q{
            bt|backtrace\t\talias for where - display stack frames
         }
            end
        s += %Q{
Print the entire stack frame. Each frame is numbered, the most recent
frame is 0. 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 -->.  } 
      end
help_command() click to toggle source
# File cli/ruby-debug/commands/frame.rb, line 176
def help_command
  %wwhere backtrace|
end

Public Instance Methods

execute() click to toggle source
# File cli/ruby-debug/commands/frame.rb, line 160
def execute
  (0...@state.context.stack_size).each do |idx|
    if idx == @state.frame_pos
      print "--> "
    else
      print "    "
    end
    print_frame(idx)

  end
  if truncated_callstack?(@state.context, Debugger.start_sentinal)
    print "Warning: saved frames may be incomplete; compare with caller(0).\n" 
  end
end
regexp() click to toggle source
# File cli/ruby-debug/commands/frame.rb, line 156
def regexp
  %r^\s*(?:w(?:here)?|bt|backtrace)$/
end