Class: DEBUGGER__::ISeqBreakpoint

Inherits:
Breakpoint show all
Defined in:
lib/debug/breakpoint.rb

Instance Attribute Summary

Attributes inherited from Breakpoint

#key, #skip_src

Instance Method Summary collapse

Methods inherited from Breakpoint

#delete, #deleted?, #description, #disable, #duplicable?, #enabled?, #generate_label, #oneshot?, #safe_eval, #skip_path?, #suspend, #to_s

Methods included from Color

#color_pp, #colored_inspect, #colorize, #colorize_blue, #colorize_code, #colorize_cyan, #colorize_dim, #colorize_magenta, #irb_colorize, #with_inspection_error_guard

Methods included from SkipPathHelper

#skip_config_skip_path?, #skip_internal_path?, #skip_location?, #skip_path?

Constructor Details

#initialize(iseq, events, oneshot: false) ⇒ ISeqBreakpoint

Returns a new instance of ISeqBreakpoint.



112
113
114
115
116
117
118
119
# File 'lib/debug/breakpoint.rb', line 112

def initialize iseq, events, oneshot: false
  @events = events
  @iseq = iseq
  @oneshot = oneshot
  @key = [:iseq, @iseq.path, @iseq.first_lineno].freeze

  super(nil, nil, nil)
end

Instance Method Details

#enableObject



128
129
130
# File 'lib/debug/breakpoint.rb', line 128

def enable
  @tp.enable(target: @iseq)
end

#setupObject



121
122
123
124
125
126
# File 'lib/debug/breakpoint.rb', line 121

def setup
  @tp = TracePoint.new(*@events) do |tp|
    delete if @oneshot
    suspend
  end
end