Class: Debugger::EventProcessor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interface) ⇒ EventProcessor

Returns a new instance of EventProcessor.



8
9
10
11
12
# File 'lib/ruby-debug/event_processor.rb', line 8

def initialize(interface)
  @printer = XmlPrinter.new(interface)
  @line = nil
  @file = nil
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



6
7
8
# File 'lib/ruby-debug/event_processor.rb', line 6

def context
  @context
end

#fileObject

Returns the value of attribute file.



6
7
8
# File 'lib/ruby-debug/event_processor.rb', line 6

def file
  @file
end

#lineObject

Returns the value of attribute line.



6
7
8
# File 'lib/ruby-debug/event_processor.rb', line 6

def line
  @line
end

Instance Method Details

#at_breakpoint(context, breakpoint) ⇒ Object



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

def at_breakpoint(context, breakpoint)
  n = Debugger.breakpoints.index(breakpoint) + 1
  @printer.print_breakpoint n, breakpoint
end

#at_catchpoint(context, excpt) ⇒ Object



19
20
21
# File 'lib/ruby-debug/event_processor.rb', line 19

def at_catchpoint(context, excpt)
  @printer.print_catchpoint(excpt)
end

#at_line(context, file, line) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ruby-debug/event_processor.rb', line 27

def at_line(context, file, line)
  @printer.print_at_line(file, line) if context.nil? || context.stop_reason == :step
  @line=line
  @file =file
  @context = context
  @printer.print_debug("Stopping Thread %s", context.thread.to_s)
  @printer.print_debug("Threads equal: %s", Thread.current == context.thread)
  Thread.stop
  @printer.print_debug("Resumed Thread %s", context.thread.to_s)
  @line=nil
  @file = nil
  @context = nil
end

#at_line?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/ruby-debug/event_processor.rb', line 41

def at_line?
   @line
end

#at_tracing(context, file, line) ⇒ Object



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

def at_tracing(context, file, line)
  @printer.print_trace(context, file, line)
end