Class Debugger::Interface
In: cli/ruby-debug/interface.rb
Parent: Object

An Interface is the kind of input/output interaction that goes on between the user and the debugged program. It includes things like how one wants to show error messages, or read input. This is the base class. Subclasses inlcude Debugger::LocalInterface, Debugger::RemoteInterface and Debugger::ScriptInterface.

Methods

afmt   aprint   errmsg   finalize   new  

Attributes

have_readline  [W] 

Public Class methods

[Source]

    # File cli/ruby-debug/interface.rb, line 11
11:     def initialize
12:       begin
13:         require 'readline'
14:         @have_readline = true
15:         @history_save = true
16:       rescue LoadError
17:         @have_readline = false
18:         @history_save = false
19:       end
20:     end

Public Instance methods

Format msg with gdb-style annotation header

[Source]

    # File cli/ruby-debug/interface.rb, line 36
36:     def afmt(msg, newline="\n")
37:       "\032\032#{msg}#{newline}"
38:     end

[Source]

    # File cli/ruby-debug/interface.rb, line 40
40:     def aprint(msg)
41:       print afmt(msg)
42:     end

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

[Source]

    # File cli/ruby-debug/interface.rb, line 24
24:     def errmsg(*args)
25:       if Debugger.annotate.to_i > 2
26:         aprint 'error-begin'
27:         print(*args)
28:         aprint ''
29:       else
30:         print '*** '
31:         print(*args)
32:       end
33:     end

Things we do before terminating.

[Source]

    # File cli/ruby-debug/interface.rb, line 45
45:     def finalize
46:     end

[Validate]