Skip to content

Commit

Permalink
skip <internal:...> file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ko1 committed Dec 22, 2022
1 parent 06fb3a2 commit 7b7259d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def skip_config_skip_path?(path)
end

def skip_internal_path?(path)
path.start_with?(__dir__) || path.start_with?('<internal:')
path.start_with?(__dir__) || path.delete_prefix('!eval:').start_with?('<internal:')
end

def skip_location?(loc)
Expand Down
14 changes: 14 additions & 0 deletions test/console/control_flow_commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,20 @@ def test_unit_method_in_the_same_line
end
end

class SkipStepOnInternalCodeTest < ConsoleTestCase
def test_skip_step_on_internal_code
code = <<~RUBY
1| _a = 1.abs # step here and it should not step into Integer#abs's internal source
2| _b = _a.abs
RUBY
debug_code code do
type 's'
assert_line_num 2
type 'c'
end
end
end

#
# Tests that next/finish work for a deep call stack.
# We use different logic for computing frame depth when the call stack is above/below 4096.
Expand Down

0 comments on commit 7b7259d

Please sign in to comment.