Stream: git-wasmtime

Topic: wasmtime / PR #11982 Debug: use libcall-based traps on Pu...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

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 FuncEnvironment that, 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 _trap part, 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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

cfallin requested abrown for a review on PR #11982.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

cfallin requested wasmtime-compiler-reviewers for a review on PR #11982.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

cfallin requested pchickey for a review on PR #11982.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

cfallin requested wasmtime-core-reviewers for a review on PR #11982.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2025 at 23:39):

cfallin requested alexcrichton for a review on PR #11982.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2025 at 00:53):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2025 at 01:27):

alexcrichton merged PR #11982.


Last updated: Dec 06 2025 at 07:03 UTC