class DEBUGGER__::CheckBreakpoint

公共类方法

new(cond:, command: nil, path: nil) 点击切换源代码
调用超类方法 DEBUGGER__::Breakpoint::new
# File debug-1.10.0/lib/debug/breakpoint.rb, line 343
def initialize cond:, command: nil, path: nil
  @key = [:check, cond].freeze

  super(cond, command, path)
end

公共实例方法

setup() 点击切换源代码
# File debug-1.10.0/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_s() 点击切换源代码
调用超类方法 DEBUGGER__::Breakpoint#to_s
# File debug-1.10.0/lib/debug/breakpoint.rb, line 374
def to_s
  s = "#{generate_label("Check")}"
  s += super
  s
end

私有实例方法

need_suspend?(cond_result) 点击切换源代码
# File debug-1.10.0/lib/debug/breakpoint.rb, line 361
        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