Stream: general

Topic: WASM Debugging - presenting global & static variables


view this post on Zulip Steve Williams (Oct 28 2021 at 12:39):

Implemented here : https://github.com/adv-sw/wasmtime

Used here : https://github.com/adv-sw/lldbg

Works thus far but not comfortable passing virtual addresses as real addresses.
lldb fails them & lets us access the fail string to fix them up.

Something along lines of WebAssemblyPtrWrapper maybe to resolve cleanly.

or new DWARF DW_OP_vaddr to resolve optimally.

Standalone JIT-style runtime for WebAssembly, using Cranelift - GitHub - adv-sw/wasmtime: Standalone JIT-style runtime for WebAssembly, using Cranelift
A lightweight native GUI for LLDB. Contribute to adv-sw/lldbg development by creating an account on GitHub.

view this post on Zulip Steve Williams (Oct 28 2021 at 12:49):

Doesn't require gimil mods in the end - its very simple. Had to go long way round to learn system configuration.

view this post on Zulip Steve Williams (Oct 28 2021 at 12:51):

the code is inserted in a section where cranelift previously failed & silently ignored.

view this post on Zulip Steve Williams (Oct 31 2021 at 16:07):

Loads of refinements to lldbg.

https://github.com/adv-sw/lldbg

A lightweight native GUI for LLDB. Contribute to adv-sw/lldbg development by creating an account on GitHub.

view this post on Zulip Steve Williams (Oct 31 2021 at 18:05):

thought about global variables patch. trunk: doesn't work. patch: works as far as tested. might have real/virtual address clash issues.

so, that's progress, with no effect on anything else. so, imperfect though it is, should perhaps go in, to keep processes straightforward & aligned.

robust solutions discussed but not for me right now - other stuff to be getting on with.

view this post on Zulip Steve Williams (Nov 02 2021 at 12:56):

... and another update. fixes regression. evaluate at breakpoint is too slow so one way or another that needs a rework at some point, but meets my goal of just get it working for the time being.

view this post on Zulip Steve Williams (Nov 02 2021 at 12:58):

& with html funkiness instead of imgui, drops right into firefox for in browser web assembly debugging.

view this post on Zulip Steve Williams (Nov 03 2021 at 18:45):

readme updated. required wasmtime patch referenced link was wrong.

it's as follows : https://github.com/adv-sw/wasmtime/commit/ea208a1a8392447c414103135e5697d82cc4cdf3

as suggested, should perhaps go in so we stay in sync. won't break anything that isn't already broken.

…irst pass solution. Virtual pointers passed as regular addresses. Not ideal.

Last updated: Oct 23 2024 at 20:03 UTC