Skip to content

Commit 7b7259d

Browse files
committed
skip <internal:...> file
For the `<internal:...>` files does not have a file and `absolute_path` is nil, so it is assumed as eval'ed code and `skip_location?` add prefix `!eval:` to the path name. So it also cheks with this prefix too. fix #866
1 parent 06fb3a2 commit 7b7259d

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

lib/debug/thread_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def skip_config_skip_path?(path)
2929
end
3030

3131
def skip_internal_path?(path)
32-
path.start_with?(__dir__) || path.start_with?('<internal:')
32+
path.start_with?(__dir__) || path.delete_prefix('!eval:').start_with?('<internal:')
3333
end
3434

3535
def skip_location?(loc)

test/console/control_flow_commands_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,20 @@ def test_unit_method_in_the_same_line
493493
end
494494
end
495495

496+
class SkipStepOnInternalCodeTest < ConsoleTestCase
497+
def test_skip_step_on_internal_code
498+
code = <<~RUBY
499+
1| _a = 1.abs # step here and it should not step into Integer#abs's internal source
500+
2| _b = _a.abs
501+
RUBY
502+
debug_code code do
503+
type 's'
504+
assert_line_num 2
505+
type 'c'
506+
end
507+
end
508+
end
509+
496510
#
497511
# Tests that next/finish work for a deep call stack.
498512
# We use different logic for computing frame depth when the call stack is above/below 4096.

0 commit comments

Comments
 (0)