-
Notifications
You must be signed in to change notification settings - Fork 124
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
Handle evaled source code #10
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Otherwise it would fail with: ``` No such file or directory @ rb_sysopen - eval (Errno::ENOENT) ``` I could explictly check for `"eval"` but I think it's better to handle all potential file system issues.
Thank you for the report. I'm not sure how to reproduce it. Maybe it is related to the |
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem "debug", "1.0.0.beta3"
end
module Foo
module_eval <<~RUBY, '--eval--', 1
def self.bar
binding.bp
end
RUBY
end
Foo.bar
|
ko1
added a commit
that referenced
this pull request
May 17, 2021
`eval` can specify unexisting file so it shouldn't read. Without `eval` the file can be removed just after compiling, the error should not be propagated. If given file is existing file for eval context, it should not override the source code. The issue is pointed at #10 by casperisfine and this patc contains a part of his patch.
Thank you, I could reproduce and I solved with other patch. |
ono-max
referenced
this pull request
in ono-max/debug
May 23, 2021
Show more pretty backtrace like: ``` (rdbg) bt =>#0 block{|i=0, j=nil|} (3 levels) in foo at ~/src/rb/target.rb:12 #1 [C] Integer#times at ~/src/rb/target.rb:11 #2 rescue in rescue in block (2 levels) in foo at ~/src/rb/target.rb:11 #3 rescue in block (2 levels) in foo at ~/src/rb/target.rb:8 #4 block (2 levels) in foo at ~/src/rb/target.rb:5 #5 [C] Integer#times at ~/src/rb/target.rb:4 #6 block{|e=2|} in foo at ~/src/rb/target.rb:4 #7 [C] Range#each at ~/src/rb/target.rb:3 #8 [C] Enumerable#map at ~/src/rb/target.rb:3 #9 Object#foo(a=3) at ~/src/rb/target.rb:3 #10 <main> at ~/src/rb/target.rb:20 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the issue reported here: https://bugs.ruby-lang.org/issues/17863#note-1
Otherwise it would fail with:
I could explictly check for
"eval"
but I think it's better to handle all potential file system issues, because eval interfaces allow to provide arbitrary paths.cc @ko1