Class: Debugger::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-debug/processor.rb

Overview

Should this be a mixin?

Direct Known Subclasses

CommandProcessor, ControlCommandProcessor

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#interfaceObject

:nodoc



8
9
10
# File 'lib/ruby-debug/processor.rb', line 8

def interface
  @interface
end

Instance Method Details

#afmt(msg, newline = "\n") ⇒ Object

Format msg with gdb-style annotation header



11
12
13
# File 'lib/ruby-debug/processor.rb', line 11

def afmt(msg, newline="\n")
  "\032\032#{msg}#{newline}"
end

#aprint(msg) ⇒ Object



15
16
17
# File 'lib/ruby-debug/processor.rb', line 15

def aprint(msg)
  print afmt(msg) if Debugger.annotate.to_i > 2
end

#errmsg(*args) ⇒ Object

FIXME: use delegate?



20
21
22
# File 'lib/ruby-debug/processor.rb', line 20

def errmsg(*args)
  @interface.errmsg(*args)
end

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.



30
31
32
# File 'lib/ruby-debug/processor.rb', line 30

def print(*args)
  @interface.print(*args)
end