Sha256: 94cfea789e9459299bc0ae2ae8d34539034c2a79b988465f3f5c967b7f95b62f

Contents?: true

Size: 1.59 KB

Versions: 18

Compression:

Stored size: 1.59 KB

Contents

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

class Trepan::Subcommand::SetMaxStack < Trepan::SubSubcommand
  unless defined?(HELP)
    HELP         = 'Set number of backtrace lines the debugger will show'
    DEFAULT_MIN  = 3
    MIN_ABBREV   = 'sta'.size
    NAME         = File.basename(__FILE__, '.rb')
    PREFIX       = %w(set max stack)
  end

  def run(args)
    args.shift
    args = %W(#{DEFAULT_MIN}) if args.empty?
    run_set_int(args.join(' '),
                "The '#{PREFIX.join(' ')}' command requires a list size", 
                DEFAULT_MIN, nil)
  end

  alias save_command save_command_from_settings

end

if __FILE__ == $0
  # Demo it.
  require_relative '../../../mock'
  dbgr, set_cmd = MockDebugger::setup('set')
  name = File.basename(__FILE__, '.rb')

  dbgr, set_cmd = MockDebugger::setup('set')
  max_cmd       = Trepan::SubSubcommand::SetMax.new(dbgr.processor, 
                                                      set_cmd)
  cmd_ary       = Trepan::SubSubcommand::SetMaxStack::PREFIX
  cmd_name      = cmd_ary.join('')
  subcmd        = Trepan::SubSubcommand::SetMaxStack.new(set_cmd.proc,
                                                         max_cmd,
                                                         cmd_name)
  prefix_run = cmd_ary[1..-1]
  subcmd.run(prefix_run)
  subcmd.run(prefix_run + %w(0))
  subcmd.run(prefix_run + %w(20))
  name = File.basename(__FILE__, '.rb')
  subcmd.summary_help(name)
  puts
  puts '-' * 20
  puts subcmd.save_command
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.6 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.5 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.4 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.3 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 processor/command/set_subcmd/max_subcmd/stack.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.7-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.6-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.5-universal-rubinius-1.2.1 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.4-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.3-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.2-universal-rubinius-1.2 processor/command/set_subcmd/max_subcmd/stack.rb
rbx-trepanning-0.0.1-universal-rubinius processor/command/set_subcmd/max_subcmd/stack.rb