123456789_123456789_123456789_123456789_123456789_

Class: DEBUGGER__::CheckBreakpoint

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Breakpoint
Instance Chain:
Inherits: DEBUGGER__::Breakpoint
Defined in: lib/debug/breakpoint.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Breakpoint - Inherited

Color - Included

#color_pp

See additional method definition at line 50.

#colored_inspect,
#colorize

See additional method definition at line 36.

#colorize_blue,
#colorize_code

See additional method definition at line 79.

#colorize_cyan, #colorize_dim, #colorize_magenta,
#irb_colorize

See additional method definition at line 27.

#with_inspection_error_guard

SkipPathHelper - Included

Constructor Details

.new(cond:, command: nil, path: nil) ⇒ CheckBreakpoint

[ GitHub ]

  
# 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

#need_suspend?(cond_result) ⇒ Boolean (private)

[ GitHub ]

  
# File 'lib/debug/breakpoint.rb', line 363

private 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

#setup

[ GitHub ]

  
# 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_s

[ GitHub ]

  
# File 'lib/debug/breakpoint.rb', line 376

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