fitzgen edited issue #5518:
I think these were a SpiderMonkey-ism? Unused now, AFAICT.
bjorn3 commented on issue #5518:
Note that
debug_trapmust keepint3as lowering. Otherwise debuggers get confused. This could be done by adding a trap code for a breakpoint. I don't think there is precedent for changing codegen depending on the trap code though. I believe it is currently extra information that can be stored in a side table.
fitzgen closed issue #5518:
I think these were a SpiderMonkey-ism? Unused now, AFAICT.
fitzgen commented on issue #5518:
I think we must have gotten rid of this at some point, because
debug_trapno longer exists in the code base.
bjorn3 commented on issue #5518:
It is now called
debugtrapand still used by cg_clif for implementing thebreakpointrust intrinsic.
fitzgen commented on issue #5518:
Yeah, I actually discovered the renaming that took place at some point just now as well.
Is there a reason that cg_clif has to use
debugtrapinstead of a normaltrap?
bjorn3 commented on issue #5518:
trapgeneratesud2which is not resumable and producesSIGILL, whiledebugtrapgeneratesint3which is resumable and which debuggers handle identical to a breakpoint set using the debugger itself.
fitzgen commented on issue #5518:
Gotcha.
FWIW,
debugtrapproduceshlt, notint3, on x64 right now. I guess this doesn't matter though?
bjorn3 commented on issue #5518:
It actually generates
int3, but the instruction is called wrong in the Cranelift backend: https://github.com/bytecodealliance/wasmtime/blob/34b6b6738e22e13e66336a28fb4f1a1beb3e46e5/cranelift/codegen/src/isa/x64/inst/emit.rs#L4018-L40200xccisint3.hltwould be0xf4.
bjorn3 edited a comment on issue #5518:
It actually generates
int3, but the instruction is called wrong in the x86_64 backend: https://github.com/bytecodealliance/wasmtime/blob/34b6b6738e22e13e66336a28fb4f1a1beb3e46e5/cranelift/codegen/src/isa/x64/inst/emit.rs#L4018-L40200xccisint3.hltwould be0xf4.
bjorn3 edited a comment on issue #5518:
It actually generates
int3, but the instruction is called wrong in the x86_64 backend: https://github.com/bytecodealliance/wasmtime/blob/34b6b6738e22e13e66336a28fb4f1a1beb3e46e5/cranelift/codegen/src/isa/x64/inst/emit.rs#L4018-L40200xccisint3[^1].hltwould be0xf4[^2].[^1]: https://www.felixcloutier.com/x86/intn:into:int3:int1
[^2]: https://www.felixcloutier.com/x86/hlt
fitzgen commented on issue #5518:
Good to know. Either way, it seems like we shouldn't actually get rid of this, so I'm leaving the issue closed.
Last updated: Dec 13 2025 at 19:03 UTC