class DEBUGGER__::CheckBreakpoint

Public Class Methods

new(cond:, command: nil, path: nil) click to toggle source
Calls superclass method DEBUGGER__::Breakpoint::new
# File debug-1.6.3/lib/debug/breakpoint.rb, line 339
def initialize cond:, command: nil, path: nil
  @key = [:check, cond].freeze

  super(cond, command, path)
end

Public Instance Methods

setup() click to toggle source
# File debug-1.6.3/lib/debug/breakpoint.rb, line 345
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_s() click to toggle source
Calls superclass method DEBUGGER__::Breakpoint#to_s
# File debug-1.6.3/lib/debug/breakpoint.rb, line 370
def to_s
  s = "#{generate_label("Check")}"
  s += super
  s
end

Private Instance Methods

need_suspend?(cond_result) click to toggle source
# File debug-1.6.3/lib/debug/breakpoint.rb, line 357
        def need_suspend? cond_result
  map = ThreadClient.current.check_bp_fulfillment_map
  if cond_result
    if map[self]
      false
    else
      map[self] = true
    end
  else
    map[self] = false
  end
end