Class: Break::TracePointCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/break/commands/tracepoint_command.rb

Direct Known Subclasses

DownCommand, NextCommand, StepCommand, UpCommand

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTracePointCommand

Returns a new instance of TracePointCommand.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/break/commands/tracepoint_command.rb', line 13

def initialize(*)
  super

  @delayed_context = Fiber.new do |*args|
    session.context!(*args)

    loop do
      session.context!(*Fiber.yield)
    end
  end
end

Class Attribute Details

.trace_eventsObject (readonly)

Returns the value of attribute trace_events.



6
7
8
# File 'lib/break/commands/tracepoint_command.rb', line 6

def trace_events
  @trace_events
end

Class Method Details

.trace(*events) ⇒ Object



8
9
10
# File 'lib/break/commands/tracepoint_command.rb', line 8

def trace(*events)
  @trace_events = events
end

Instance Method Details

#execute(*args) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/break/commands/tracepoint_command.rb', line 25

def execute(*args)
  TracePoint.trace(*trace_events) do |trace|
    next if Filter.internal?(trace.path)

    execute_trace(trace, *args)
  end

  session.leave
end

#execute_traceObject

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/break/commands/tracepoint_command.rb', line 35

def execute_trace
  raise NotImplementedError
end