Parent

Debugger::Processor

Should this be a mixin?

Attributes

interface[RW]

Public Class Methods

protect(mname) click to toggle source
# File lib/ruby-debug/processor.rb, line 12
def self.protect(mname)
  alias_method "__#{mname}", mname
  module_eval %{
    def #{mname}(*args)
      @mutex.synchronize do
        return unless @interface
        __#{mname}(*args)
      end
    rescue IOError, Errno::EPIPE
      self.interface = nil
    rescue SignalException
      raise
    rescue Exception
      print "INTERNAL ERROR!!! #\{$!\}\n" rescue nil
      print $!.backtrace.map{|l| "\t#\{l\}"}.join("\n") rescue nil
    end
  }
end

Public Instance Methods

afmt(msg, newline="\n") click to toggle source

Format msg with gdb-style annotation header

# File lib/ruby-debug/processor.rb, line 32
def afmt(msg, newline="\n")
  "\0032\0032#{msg}#{newline}"
end
aprint(msg) click to toggle source
# File lib/ruby-debug/processor.rb, line 36
def aprint(msg)
  print afmt(msg) if Debugger.annotate.to_i > 2
end
errmsg(*args) click to toggle source

FIXME: use delegate?

# File lib/ruby-debug/processor.rb, line 41
def errmsg(*args)
  @interface.errmsg(*args)
end
split_commands(input) click to toggle source

Split commands like this: split_commands(“abc;def\;ghi;jkl”) => [“abc”, “def;ghi”, “jkl”]

# File lib/ruby-debug/processor.rb, line 57
def split_commands(input)
  input.split(/(?<!\\);/).map { |e| e.gsub("\\;", ";") }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.