fitzgen edited issue #5518:
I think these were a SpiderMonkey-ism? Unused now, AFAICT.
bjorn3 commented on issue #5518:
Note that
debug_trap
must keepint3
as 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_trap
no longer exists in the code base.
bjorn3 commented on issue #5518:
It is now called
debugtrap
and still used by cg_clif for implementing thebreakpoint
rust 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
debugtrap
instead of a normaltrap
?
bjorn3 commented on issue #5518:
trap
generatesud2
which is not resumable and producesSIGILL
, whiledebugtrap
generatesint3
which is resumable and which debuggers handle identical to a breakpoint set using the debugger itself.
fitzgen commented on issue #5518:
Gotcha.
FWIW,
debugtrap
produceshlt
, 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-L40200xcc
isint3
.hlt
would 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-L40200xcc
isint3
.hlt
would 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-L40200xcc
isint3
[^1].hlt
would 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 23 2024 at 12:05 UTC