Sha256: 9edeacd356b9ffec35702d9019ce880d20780530bd6141bb325b33339bd5bbf1

Contents?: true

Size: 1006 Bytes

Versions: 1

Compression:

Stored size: 1006 Bytes

Contents

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

class Trepan::SubSubcommand::SetTracePrint < Trepan::SetBoolSubSubcommand
  unless defined?(HELP)
    Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
    HELP         = <<-EOH
#{CMD} [on|off|1|0]

Set printing trace events.
    EOH

    MIN_ABBREV   = 'p'.size  
    SHORT_HELP   = 'Set print trace events'
  end

  def run(args)
    super
    if settings[:traceprint]
      @proc.unconditional_prehooks.insert_if_new(-1, *@proc.trace_hook)
    else
      @proc.unconditional_prehooks.delete_by_name('trace')
    end
  end

end

if __FILE__ == $0
  # Demo it.
  require_relative '../../../mock'
  require_relative '../trace'
  cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::SetTrace,
                                   Trepan::SubSubcommand::SetTracePrint)
  %w(off on 1 0).each do |arg|
      cmd.run([cmd.name, arg])
  end
  puts cmd.save_command()
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trepanning-0.1.3 processor/command/set_subcmd/trace_subcmd/print.rb