Class: Debugger::Processor

### Home Classes Methods

### In Files

- lib/debugger/test/processor.rb
- lib/ruby-debug/processor.rb

### Parent

Object

### Methods

- ::print
- ::protect
- #afmt
- #aprint
- #errmsg
- #print
- #split_commands

### Class/Module Index

Quicksearch

- Debugger
- Debugger::AddBreakpoint
- Debugger::Breakpoint
- Debugger::Context
- Debugger::ContinueCommand
- Debugger::DeleteBreakpointCommand
- Debugger::FinishCommand
- Debugger::HelpCommand
- Debugger::IRBCommand
- Debugger::InfoCommand
- Debugger::JumpCommand
- Debugger::KillCommand
- Debugger::ListCommand
- Debugger::LocalInterface
- Debugger::LocalInterface::Debugger
- Debugger::MethodCommand
- Debugger::MethodSigCommand
- Debugger::NextCommand
- Debugger::ParseFunctions
- Debugger::Processor
- Debugger::QuitCommand
- Debugger::ReloadCommand
- Debugger::SetCommand
- Debugger::ShowCommand
- Debugger::SkipCommand
- Debugger::SourceCommand
- Debugger::StepCommand
- Debugger::VarClassVarCommand
- Debugger::VarInheritCommand
- Debugger::VarLocalCommand
- Debugger::WhereCommand
- Printers
- Printers::Base
- Printers::Base::MissedArgument
- Printers::Base::MissedPath
- Printers::Plain
- Mocha
- Mocha::Call
- Mocha::Expectation
- Mocha::Mock
- MiniTest
- MiniTest::Assertions
- MiniTest::Expectations
- TestDsl
- TestDsl::ClassMethods
- TestDsl::Shared
- Kernel
- Module
- PrinterHelpers
- TestInterface

No matching classes.

# Debugger::Processor

Should this be a mixin?

### Attributes

interface[RW]

### Public Class Methods

print(message) click to toggle source

    # File lib/debugger/test/processor.rb, line 3
    def print(message)
      Debugger.handler.interface.print_queue << message
    end

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

print(*args) click to toggle source

Callers of this routine should make sure to use comma to separate format argments rather than %. Otherwise it seems that if the string you want to print has format specifier, which could happen if you are trying to show say a source-code line with "puts" or "print" in it, this print routine will give an error saying it is looking for more arguments.

    # File lib/ruby-debug/processor.rb, line 51
    def print(*args)
      @interface.print(*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.