Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpectedly stepping into prelude methods like binding.irb #866

Closed
st0012 opened this issue Dec 9, 2022 · 0 comments · Fixed by #872
Closed

Unexpectedly stepping into prelude methods like binding.irb #866

st0012 opened this issue Dec 9, 2022 · 0 comments · Fixed by #872
Labels
bug Something isn't working
Milestone

Comments

@st0012
Copy link
Member

st0012 commented Dec 9, 2022

Your environment

  • ruby -v: 1.7.0
  • rdbg -v: 3.1.2

Describe the bug

step command can step into Ruby's prelude methods, like binding.irb.

rdbg -e 's' test.rb
[1, 3] in test.rb
=>   1| binding.irb
     2|
     3| a = 1
=>#0    <main> at test.rb:1
(rdbg:commands) s
# No sourcefile available for <internal:prelude>
=>#0    Binding#irb at <internal:prelude>:19
  #1    <main> at test.rb:1
(rdbg)

But looking at the code, it should be skipped by skip_internal_path?.

To Reproduce

# test.rb
binding.irb

a = 1 # not important
$ rdbg -e 's' test.rb

Expected behavior

It shouldn't step into the prelude method but directly into IRB's internal.

Additional context

This is because skip_location? appends !eval: to the frame path, so path.start_with?('<internal:') failed to match it.

@ko1 ko1 added the bug Something isn't working label Dec 22, 2022
@ko1 ko1 added this to the v1.7.1 milestone Dec 22, 2022
ko1 added a commit that referenced this issue Dec 22, 2022
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
@ko1 ko1 closed this as completed in #872 Dec 22, 2022
ko1 added a commit that referenced this issue Dec 22, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants