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?, #pending_until_load?, #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



345
346
347
348
349
# File 'lib/debug/breakpoint.rb', line 345

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

  super(cond, command, path)
end

Instance Method Details

#setupObject



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

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



376
377
378
379
380
# File 'lib/debug/breakpoint.rb', line 376

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