-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Handle the breakpoint intrinsic #34
Comments
Could we add a way for priroda to skip the current instruction instead of stepping on it? Then we could just interpret until the breakpoint instruction is hit (which errors), manually skip it, and then continue interpreting. |
I believe @RalfJung objects to changing the current location outside of regular steps. Or did I misinterpret https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Frame.3A.3Aloc.20no.20longer.20public/near/228074161 |
Couldn't you just have another implementation of the intrinsic that doesn't do anything / signals something to priroda? That seems cleaner than messing with the program counter. |
Yeah, I think that seems correct. Currently I don't |
@RalfJung I don't think there's any feasible way for priroda to overwrite miri's intrinsics at the moment. The problem is that we cannot create a Additionally, simply copy-pasting the definitions from |
@DJMcNab hm... yeah that seems tricky indeed. What is the least-overhead way for Miri to provide "hooks" that downstream creates could fill in with their own code? |
I think the least intrusive way would be adding an |
Unfortunately for other changes we'll likely want a custom machine. For example, a final form of #14, would likely require that we can cheaply clone It's possible that #14 is infeasible anyway because it would break aliasing guarantees. Although if we bail as unprintable on UB (or even some subset of UB), we should be fine. |
That being said, a hook literally for the breakpoint intrinsic would probably be 'good enough for now' |
I'd prefer something slightly less ad-hoc than a hook for a specific intrinsic.
The only way I see to allow that would be to make much of Miri generic in the machine, which sounds like it'll add a lot of boilerplate on the Miri side. :/ |
Yeah, at first glance there aren't many good solutions. A possible alternative would be change upstream That being said, for the moment we don't need to handle the breakpoint intrinsic, since in practise it isn't likely to be in heavy use. |
rust-lang/miri#1733 (comment)
The text was updated successfully, but these errors were encountered: