Sha256: 779d8ad382f98a3d3f08243bcbd17b9b924abef96dc3073478de699018b8b19e

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../../base/subsubcmd'
require_relative '../trace'
class Trepan::SubSubcommand::SetTraceBuffer < Trepan::SetBoolSubSubcommand
  Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
  unless defined?(HELP)
    HELP         = <<-EOH
#{CMD} [on|off|1|0]

Set saving trace events in a buffer
    EOH
    MIN_ABBREV   = 'b'.size  
    SHORT_HELP   = 'Set saving trace events in a buffer'
  end

  def run(args)
    super
    if settings[:tracebuffer]
      # @proc.start_capture
      @proc.unconditional_prehooks.insert_if_new(-1, *@proc.tracebuf_hook)
    else
      @proc.unconditional_prehooks.delete_by_name('tracebuffer')
      # @proc.stop_capture
    end
  end

end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/set_subcmd/trace_subcmd/buffer.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/set_subcmd/trace_subcmd/buffer.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/set_subcmd/trace_subcmd/buffer.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/set_subcmd/trace_subcmd/buffer.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 processor/command/set_subcmd/trace_subcmd/buffer.rb