One issue is indeed constant values, another issue is registers shared by multiple values on the stack, or between locals and the value stack. E.g. a `local.get` typically does not emit any code, the register which holds the local is just reused for holding the top-of-value-stack value. So you cannot modify one without modifying the other.
We already emit special "for debugging" Liftoff code, so we could make sure to always materialize constants and never share registers. It would be some work though, and adds complexity, and so far no one missed the feature to modify values while debugging Wasm. On Mon, Sep 8, 2025 at 5:19 PM Elias <elias.bota...@gmail.com> wrote: > Hi, > > While it's possible to inspect WASM locals/stack through DevTools, there > seems to be no way to change their values. I'm wondering if there's a > reason why this was not implemented. > > From my understanding, when debugging, the baseline compiler is always > used, which doesn't optimize away locals (?), so that shouldn't pose a > problem. wasm-debug.cc has GetValue/GetLocalValue/GetStackValue and it > would look fairly trivial to implement functions for setting them, and then > updating LocalsProxy/StackProxy to have a setter. The only edge case I can > think of are constant values. > > Am I missing something? I could not find any discussions on this topic. > > Thanks! > > -- > -- > v8-dev mailing list > v8-dev@googlegroups.com > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-dev+unsubscr...@googlegroups.com. > To view this discussion visit > https://groups.google.com/d/msgid/v8-dev/ad58f2fe-894d-433d-b226-114cc20314a1n%40googlegroups.com > <https://groups.google.com/d/msgid/v8-dev/ad58f2fe-894d-433d-b226-114cc20314a1n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Clemens Backes Software Engineer cleme...@google.com Google Germany GmbH Erika-Mann-Straße 33 80636 München Geschäftsführer: Paul Manicle, Liana Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhDmYnkNrzWnyLjVhUgwNWF-YZhkWAUOz7O_hvq_S5G4rw%40mail.gmail.com.