cfallin opened PR #11982 from cfallin:pulley-debug-no-traps to bytecodealliance:main:
This PR is one step in #11964. It updates the Wasm lowering to Pulley to fully support libcall-based traps, as this will be the only supported method of handling traps when debugging Wasm with our guest-debugging functionality.
Previously, compilation targeting Pulley was special-cased to continue to use "trapping" Pulley instructions even when signal-based traps were turned off, because the Pulley interpreter handles these "traps" in (host) software, so we still didn't require OS-level signal interception. But this is not good enough for debugging support because we need the actual libcall to enter the runtime and pass ownership of the store so that a debugger hook, if any, can run. Thus, we modify the predicate on the
FuncEnvironmentthat, conveniently, is the central decision point for whether to use trapping instructions.Doing this then hits an unimplemented opcode in Pulley:
uadd_overflow, without the_trappart, returning a second result indicating whether an overflow occurred. This PR implements that opcode in the straightforward way with a compare of the sum against one of the summands (as also done by e.g. aarch64).With this, Pulley debugging is again at parity with native.
cfallin requested abrown for a review on PR #11982.
cfallin requested wasmtime-compiler-reviewers for a review on PR #11982.
cfallin requested pchickey for a review on PR #11982.
cfallin requested wasmtime-core-reviewers for a review on PR #11982.
cfallin requested alexcrichton for a review on PR #11982.
alexcrichton submitted PR review.
alexcrichton merged PR #11982.
Last updated: Dec 06 2025 at 07:03 UTC