-
Notifications
You must be signed in to change notification settings - Fork 130
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
No sourcefile available
when debug gem is required inside an eval and breaking into the debugger inside
#479
Comments
Thank you for your report. I'll investigate it. BTW |
Ah, this is from Ruby 3.1 changes. I'll fix it soon (maybe in Jan). |
I was curious about this so spent a little time investigating. @ko1 do you think this is happening because the Also, as an aside, while investigating this I found |
From Ruby 3.1, a path given by eval does not return by `ISeq#absolute_path`. fix #479 With this fix, use `File.readlines(chomp: true)`.
Your investigation is correct. However, if a file name is given for |
From Ruby 3.1, a path given by eval does not return by `ISeq#absolute_path`. fix #479 With this fix, use `File.readlines(chomp: true)`.
Your environment
ruby -v
:ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
rdbg -v
:rdbg 1.4.0
Describe the bug
I decided to try out the new debug gem bundled with ruby 3.1.0, but it looks like I did too much black magic with how I load my code and it broke. I'm not 100% sure this is valid usage of this gem though, so feel free to close this issue if it is invalid.
To Reproduce
I have two files,
a.rb
:and
b.rb
:Running
ruby b.rb
, I get:If I require
debug
inb.rb
, it works. If I userequire_relative 'a'
instead of File.read+eval, it works. If I requiredebug
in a separateeval
inb.rb
, it also works. So doesruby -rdebug b.rb
, andrdbg b.rb
, obviously.Expected behavior
It should display the source properly:
Additional context
Sorry.
The text was updated successfully, but these errors were encountered: