Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions lib/debug/breakpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,36 +326,30 @@ def setup
next if ThreadClient.current.management?
next if skip_path?(tp.path)

if safe_eval(tp.binding, @cond)
unless fulfilled_on_current_thread?
set_fulfilled_on_current_thread
suspend
end
else
set_unfulfilled_on_current_thread
if need_suspend? safe_eval(tp.binding, @cond)
suspend
end
}
end

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

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

private

def fulfilled_on_current_thread?
ThreadClient.current.check_bp_fulfilled?(self)
end

def set_fulfilled_on_current_thread
ThreadClient.current.set_check_bp_state(self, true)
end

def set_unfulfilled_on_current_thread
ThreadClient.current.set_check_bp_state(self, false)
end
end

class WatchIVarBreakpoint < Breakpoint
Expand Down
10 changes: 1 addition & 9 deletions lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.current
include Color
include SkipPathHelper

attr_reader :thread, :id, :recorder
attr_reader :thread, :id, :recorder, :check_bp_fulfillment_map

def location
current_frame&.location
Expand Down Expand Up @@ -339,14 +339,6 @@ def step_tp iter, events = [:line, :b_return, :return]
end
end

def set_check_bp_state(bp, state)
@check_bp_fulfillment_map[bp] = state
end

def check_bp_fulfilled?(bp)
@check_bp_fulfillment_map[bp]
end

## cmd helpers

if TracePoint.respond_to? :allow_reentry
Expand Down