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

TracePoint.new(:raise) not yet supported #3680

Open
eregon opened this issue Oct 2, 2024 Discussed in #3679 · 3 comments
Open

TracePoint.new(:raise) not yet supported #3680

eregon opened this issue Oct 2, 2024 Discussed in #3679 · 3 comments

Comments

@eregon
Copy link
Member

eregon commented Oct 2, 2024

Discussed in #3679

Originally posted by stdedos October 2, 2024
I am trying to build a quick pipeline for https://github.com/ConradIrwin/interception (stdedos/interception@4ff277c), but it seems that "no truffleruby variant" supports TracePoint.new(:raise)?

https://github.com/stdedos/interception/actions/runs/11141771488/job/30963350904#step:5:19

I am not very involved with ruby - but you do claim:

https://www.graalvm.org/ruby/
TruffleRuby aims to be fully compatible with the standard Ruby runtime (MRI/CRuby)

So I thought it is not far-fetched to at least ask for some quick tips 🙏

@eregon eregon changed the title TracePoint.new(:raise)` not yet supported TracePoint.new(:raise) not yet supported Oct 2, 2024
@eregon
Copy link
Member Author

eregon commented Oct 2, 2024

@stdedos Thanks for the report.
Indeed, the TracePoint :raise event is not yet supported on TruffleRuby.

It should be possible to support it but from past experience adding support for TracePoint events is a non-trivial amount of work.

@stdedos
Copy link

stdedos commented Oct 2, 2024

Why I started a discussion also was: Is there "some way" (e.g. listed in https://github.com/ConradIrwin/interception/blob/master/lib/cross_platform.rb) to use as a workaround for now?

https://github.com/ConradIrwin/interception is "somewhere in the chain" for https://github.com/ConradIrwin/pry-rescue
(ofc https://github.com/oracle/truffleruby as somewhere mentioned that there are other debugger backends that are supported as of now)

I don't have strong requirements "to do this" - as long as it is documented missing.
(e.g. idk where would I look for valid TracePoint.new arguments, except ofc trial-and-error)

@eregon
Copy link
Member Author

eregon commented Oct 2, 2024

Is there "some way" (e.g. listed in https://github.com/ConradIrwin/interception/blob/master/lib/cross_platform.rb) to use as a workaround for now?

I think there is no way currently.
I guess one could monkey-patch Kernel#raise but it will only see Ruby exceptions thrown from Ruby code, not from Java code.
The TracePoint :raise event seems to see Ruby exceptions thrown from C code:

$ ruby -e 'TracePoint.trace(:raise) { |tp| p tp }; 1 / 0'
#<TracePoint:raise -e:1>
-e:1:in `/': divided by 0 (ZeroDivisionError)
	from -e:1:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants