Sha256: 92ee4c7cf9c1e7aa2ba39b9a15f0577d9a2ec65115c5f9ce35638f787e6ebfc0

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative 'up'

# Debugger "down" command. Is the same as the "up" command with the 
# direction (set by DIRECTION) reversed.
class Trepan::Command::DownCommand < Trepan::Command::UpCommand

  Trepan::Util.suppress_warnings {
    old_verbose = $VERBOSE  
    $VERBOSE    = nil
    HELP = <<-HELP
#{NAME} [count]

Move the current frame down in the stack trace (to a newer frame). 0
is the most recent frame. If no count is given, move down 1.

See also 'up' and 'frame'.
  HELP

    ALIASES       = %w(d)
    NAME          = File.basename(__FILE__, '.rb')
    SHORT_HELP    = 'Move frame in the direction of the caller of the last-selected frame'
  }

  def initialize(proc)
    super
    @direction = -1 # +1 for up.
  end

end

if __FILE__ == $0
  # Demo it.
  require_relative '../mock'
  dbgr, cmd = MockDebugger::setup

  # def sep ; puts '=' * 40 end
  # cmd.run [cmd.name]
  # %w(-1 0 1 -2).each do |count| 
  #   puts "#{cmd.name} #{count}"
  #   cmd.run([cmd.name, count])
  #   sep 
  # end
  # def foo(cmd, cmd.name)
  #   puts "#{cmd.name}"
  #   cmd.run([cmd.name])
  #   sep
  #   puts "#{cmd.name} -1"
  #   cmd.run([cmd.name, '-1'])
  # end
  # foo(cmd, cmd.name)
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/down.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/down.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/down.rb
rb8-trepanning-0.1.5 processor/command/down.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/down.rb
rb8-trepanning-0.1.4 processor/command/down.rb