cfallin opened PR #11873 from cfallin:wasmtime-debug-store-context to bytecodealliance:main:
This permits use of ordinary store accessors, such as GC object accessors, while viewing the stack. In #11835 and related discussion, we've concluded that (i) it is safe to provide this mutable access, including e.g. ability to do a GC, because debugger access comes only at points that are morally like hostcalls (right now, literally with a
Caller, and eventually with debug yields); and (ii) we will need this in order to provide the full range of expected debugger functionality. Even before mutation-during-debugging comes into play, with the API before this change, it was not possible to read GC objects at all (because all accessors take a mutable store).Closes #11835 (this addresses the broader question of access from the debugger, and it seems there wasn't a desire to actually refactor as that issue initially suggested).
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
cfallin requested alexcrichton for a review on PR #11873.
cfallin requested wasmtime-core-reviewers for a review on PR #11873.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this be
StoreContextMut<'a, T>instead of&'a mut StoreInner<T>? That's generally what's used in various places to avoid usingStoreInnerdirectly.
alexcrichton created PR review comment:
This seems a bit surprising to me where I'd expect that debug wouldn't have that much to do with gc in terms of conditionals relative to what the rest of the codebase already does. Do you know why debug is different in this regard?
cfallin created PR review comment:
Ah, I think I put this in as a matter of expediency when building out the debug step event for exceptions; but my only real reason was "this seems like a lot of trouble to cfg-gate" on all the relevant enums, etc. Happy to do so though.
cfallin submitted PR review.
cfallin updated PR #11873.
cfallin submitted PR review.
cfallin created PR review comment:
Done in 494e406a2b.
cfallin submitted PR review.
cfallin created PR review comment:
Done in 494e406a2b.
alexcrichton submitted PR review.
cfallin updated PR #11873.
cfallin has enabled auto merge for PR #11873.
cfallin has disabled auto merge for PR #11873.
cfallin merged PR #11873.
Last updated: Jan 10 2026 at 02:36 UTC