-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Add Ruby part of TracePoint impl #4806
Add Ruby part of TracePoint impl #4806
Conversation
- file named after C impl file in MRI
Another question: does MRI trace the exit from the |
@headius To answer your question with a "it seems so":
The last lines show me pressing Ctrl-D to leave the |
@headius Should we jettison this idea of using Ruby for a TracePoint patched implementation? |
So here's the thing. It appears that MRI does trace the return from
In JRuby, it's reversed, since we would implement it in Ruby instead of "C". I'm not sure how important this is in practice. If there's logic that's attempting to hook only C methods, it will not see the return from Big deal? No big deal? |
@olleolleolle I think we should just go with it and see what happens. Worst case we do a minor bit of porting and put it in Java. As for tests, there might be something in spec/ruby but more likely there's a test excluded under test/mri/ruby/test_tracepoint.rb. The excludes are in test/mri/excludes with file path matching test class. |
It might also be worth digging up any issue where this was added (in MRI) or opening a new one and clarifying with them how "spec" the |
Meh, I'm just going to use the Ruby version you provided to implement a Java version. I'm glad you got a chance to see how this fits together in JRuby, but we've already spent too long debating whether this minor difference is worth using Ruby for :-) |
I said this on irc last week but I think semantically this should return :return if it is implemented in Ruby. Think of Rubinius/RubyTruffle or even MRI of the future where they start writing stuff in Ruby implwise (for inlining/JIT stuff). All this stuff will just change what they are implemented in. Any tests which return this as an error seems like an impl-specific test to me. |
@enebo Yeah I never intended to tweak it so the Ruby version would do :c_return instead of :return. It's a minor difference, but it's also a five-minute patch to just write this in Java and moot the point. |
This PR adds a Ruby implementation of the class method
.trace
to TracePoint.The file is named after C impl file in MRI.
Fixes #4800
Questions for reviewer: