Class: DEBUGGER__::CheckBreakpoint

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?, #enable, #enabled?, #generate_label, #oneshot?, #safe_eval, #skip_path?, #suspend

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(cond:, command: nil, path: nil) ⇒ CheckBreakpoint

Returns a new instance of CheckBreakpoint.



343
344
345
346
347
# File 'lib/debug/breakpoint.rb', line 343

def initialize cond:, command: nil, path: nil
  @key = [:check, cond].freeze

  super(cond, command, path)
end

Instance Method Details

#setupObject



349
350
351
352
353
354
355
356
357
358
359
# File 'lib/debug/breakpoint.rb', line 349

def setup
  @tp = TracePoint.new(:line){|tp|
    next if SESSION.in_subsession? # TODO: Ractor support
    next if ThreadClient.current.management?
    next if skip_path?(tp.path)

    if need_suspend? safe_eval(tp.binding, @cond)
      suspend
    end
  }
end

#to_sObject



374
375
376
377
378
# File 'lib/debug/breakpoint.rb', line 374

def to_s
  s = "#{generate_label("Check")}"
  s += super
  s
end