Skip to content

Commit

Permalink
clarify logic for skipping line, support n <num> use
Browse files Browse the repository at this point in the history
  • Loading branch information
WillHalto authored and ko1 committed Oct 26, 2022
1 parent 759631e commit 0de8fcc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -860,14 +860,17 @@ def wait_next_action_
skip_line = false
step_tp iter do |event|
next if event == :line && skip_line
# skip line events until we see a return event
skip_line = !(event == :return || event == :b_return)

loc = caller_locations(2, 1).first
loc_path = loc.absolute_path || "!eval:#{loc.path}"

frame_depth = DEBUGGER__.frame_depth - 3

# If we're at a deeper stack depth, we can skip line events until there's a return event.
skip_line = event == :line && frame_depth > depth

# same stack depth
(DEBUGGER__.frame_depth - 3 <= depth) ||
(frame_depth <= depth) ||

# different frame
(next_line && loc_path == path &&
Expand Down

0 comments on commit 0de8fcc

Please sign in to comment.