Class: Break::StepCommand

Inherits:
TracePointCommand show all
Defined in:
lib/break/commands/step_command.rb

Instance Method Summary collapse

Methods inherited from TracePointCommand

#execute, #initialize, trace

Methods inherited from Command

#execute, #initialize

Constructor Details

This class inherits a constructor from Break::TracePointCommand

Instance Method Details

#execute_trace(trace) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/break/commands/step_command.rb', line 7

def execute_trace(trace, *)
  case trace.event
  when :call, :class, :b_call
    trace.disable

    context!(*context.bindings, trace.binding)
  when :return, :end, :b_return
    context.bindings.pop
    context.depth -= 1
  when :line
    return if context.depth.positive?

    trace.disable

    context!(*context.bindings[0...-1], trace.binding)
  end
end