Class: Debugger::Interface

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

Overview

:nodoc:

Direct Known Subclasses

LocalInterface, RemoteInterface, ScriptInterface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface.



5
6
7
# File 'lib/ruby-debug/interface.rb', line 5

def initialize
  @have_readline = false
end

Instance Attribute Details

#have_readline=(value) ⇒ Object (writeonly)

true if Readline is available



3
4
5
# File 'lib/ruby-debug/interface.rb', line 3

def have_readline=(value)
  @have_readline = value
end

Instance Method Details

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

Format msg with gdb-style annotation header



23
24
25
# File 'lib/ruby-debug/interface.rb', line 23

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

#aprint(msg) ⇒ Object



27
28
29
# File 'lib/ruby-debug/interface.rb', line 27

def aprint(msg)
  print afmt(msg)
end

#errmsg(*args) ⇒ Object

Common routine for reporting debugger error messages. Derived classed may want to override this to capture output.



11
12
13
14
15
16
17
18
19
20
# File 'lib/ruby-debug/interface.rb', line 11

def errmsg(*args)
  if Debugger.annotate.to_i > 2
    aprint 'error-begin'
    print(*args)
    aprint ''
  else
    print '*** '
    print(*args)
  end
end