Class: Debugger::CommandProcessor
- Inherits:
-
Object
- Object
- Debugger::CommandProcessor
- Defined in:
- lib/ruby-debug/processor.rb
Overview
:nodoc:
Defined Under Namespace
Classes: State
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#interface ⇒ Object
Returns the value of attribute interface.
Class Method Summary collapse
Instance Method Summary collapse
- #at_breakpoint(context, breakpoint) ⇒ Object
- #at_catchpoint(context, excpt) ⇒ Object
- #at_line(context, file, line) ⇒ Object
- #at_tracing(context, file, line) ⇒ Object
-
#initialize(interface = LocalInterface.new) ⇒ CommandProcessor
constructor
A new instance of CommandProcessor.
Constructor Details
#initialize(interface = LocalInterface.new) ⇒ CommandProcessor
Returns a new instance of CommandProcessor.
9 10 11 12 13 14 15 |
# File 'lib/ruby-debug/processor.rb', line 9 def initialize(interface = LocalInterface.new) @interface = interface @display = [] @mutex = Mutex.new @last_cmd = nil @actions = [] end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
7 8 9 |
# File 'lib/ruby-debug/processor.rb', line 7 def display @display end |
#interface ⇒ Object
Returns the value of attribute interface.
6 7 8 |
# File 'lib/ruby-debug/processor.rb', line 6 def interface @interface end |
Class Method Details
.protect(mname) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruby-debug/processor.rb', line 24 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 Exception print "INTERNAL ERROR!!! #\{$!\}\n" rescue nil print $!.backtrace.map{|l| "\t#\{l\}"}.join("\n") rescue nil end } end |
Instance Method Details
#at_breakpoint(context, breakpoint) ⇒ Object
41 42 43 44 |
# File 'lib/ruby-debug/processor.rb', line 41 def at_breakpoint(context, breakpoint) n = Debugger.breakpoints.index(breakpoint) + 1 print "Breakpoint %d at %s:%s\n", n, breakpoint.source, breakpoint.pos end |
#at_catchpoint(context, excpt) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ruby-debug/processor.rb', line 47 def at_catchpoint(context, excpt) print "Catchpoint at %s:%d: `%s' (%s)\n", context.frame_file(1), context.frame_line(1), excpt, excpt.class fs = context.stack_size tb = caller(0)[-fs..-1] if tb for i in tb print "\tfrom %s\n", i end end end |