Class: DEBUGGER__::Breakpoint
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Color ,
SkipPathHelper
|
|
Inherits: | Object |
Defined in: | lib/debug/breakpoint.rb |
Class Method Summary
Instance Attribute Summary
- #deleted? ⇒ Boolean readonly
- #duplicable? ⇒ Boolean readonly
- #enabled? ⇒ Boolean readonly
- #key readonly
- #oneshot? ⇒ Boolean readonly
- #pending_until_load? ⇒ Boolean readonly
- #skip_src readonly
Instance Method Summary
- #delete
- #description
- #disable
- #enable
- #generate_label(name)
- #safe_eval(b, expr)
- #setup
- #skip_path?(path) ⇒ Boolean
- #suspend
- #to_s
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, path, do_enable: true) ⇒ Breakpoint
Instance Attribute Details
#deleted? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/debug/breakpoint.rb', line 57
def deleted? @deleted end
#duplicable? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/debug/breakpoint.rb', line 84
def duplicable? false end
#enabled? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/debug/breakpoint.rb', line 48
def enabled? @tp.enabled? end
#key (readonly)
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 9
attr_reader :key, :skip_src
#oneshot? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/debug/breakpoint.rb', line 32
def oneshot? defined?(@oneshot) && @oneshot end
#pending_until_load? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/debug/breakpoint.rb', line 105
def pending_until_load? false end
#skip_src (readonly)
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 9
attr_reader :key, :skip_src
Instance Method Details
#delete
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 52
def delete disable @deleted = true end
#description
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 80
def description to_s end
#disable
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 44
def disable @tp&.disable end
#enable
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 40
def enable @tp.enable end
#generate_label(name)
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 101
def generate_label(name) colorize(" BP - #{name} ", [:YELLOW, :BOLD, :REVERSE]) end
#safe_eval(b, expr)
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 22
def safe_eval b, expr b.eval(expr) rescue Exception => e puts "[EVAL ERROR]" puts " expr: #{expr}" puts " err: #{e} (#{e.class})" puts "Error caused by #{self}." nil end
#setup
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 36
def setup raise "not implemented..." end
#skip_path?(path) ⇒ Boolean
# File 'lib/debug/breakpoint.rb', line 88
def skip_path?(path) case @path when Regexp !path.match?(@path) when String !path.include?(@path) else super end end
#suspend
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 61
def suspend if @command provider, pre_cmds, do_cmds = @command nonstop = true if do_cmds cmds = [*pre_cmds&.split(';;'), *do_cmds&.split(';;')] SESSION.add_preset_commands provider, cmds, kick: false, continue: nonstop end ThreadClient.current.on_breakpoint @tp, self end
#to_s
[ GitHub ]# File 'lib/debug/breakpoint.rb', line 72
def to_s s = ''.dup s << " if: #{@cond}" if defined?(@cond) && @cond s << " pre: #{@command[1]}" if defined?(@command) && @command && @command[1] s << " do: #{@command[2]}" if defined?(@command) && @command && @command[2] s end