cpunion opened issue #14062:
Reproduction
Wasmtime's built-in guest-debug gdbstub does not expose a shared linear memory in its synthetic address space. This prevents LLDB from reading globals and runtime-backed values even though source breakpoints, Wasm locals, and backtraces work.
main.wat:(module (memory (export "memory") 1 1 shared) (func $entry (export "_start") i32.const 0 i32.const 42 i32.store unreachable))Build and start guest debugging:
wat2wasm --debug-names --enable-threads main.wat -o main.wasm wasmtime run -g 1234 -W threads=y,shared-memory=y main.wasmUsing a Wasm-aware LLDB:
(lldb) target create main.wasm (lldb) process connect --plugin wasm connect://127.0.0.1:1234 (lldb) continue # stopped at the final `unreachable`, after storing 42 (lldb) process plugin packet send qXfer:memory-map:read::0,ffff response: ...<memory-map><memory type="rom" start="0x4000000000000000" length="0x51"/></memory-map> (lldb) memory read --size 4 --format decimal --count 1 0x0 error: memory read failed for 0x0The equivalent unshared memory is reported as a
ramregion at address 0 and can be read successfully.Expected result
The shared memory should appear in the RSP memory map and support reads while the guest is stopped, just like an unshared memory. Guest source-language adapters need this to inspect globals and runtime values.
Likely cause
Instance::debug_memoryintentionally returns only unsharedMemoryand directs callers todebug_shared_memoryfor shared memory:However, the debugger host API's
instance_get_memoryonly callsdebug_memory:The gdbstub address-space implementation consequently has no shared-memory resource to enumerate:
It looks like the debugger resource abstraction needs to represent both
MemoryandSharedMemory, then implement size/read/write operations for both.Environment
- Wasmtime 47.0.3 (
5554cc1a6, 2026-07-31); the same behavior was also observed with 44.0.0- wasi-sdk 33 LLDB 22.1.0 with the Wasm process plugin
- macOS arm64
This was found while implementing WASI source debugging for xgo-dev/llgo#2164, but the WAT reproduction is independent of LLGo.
alexcrichton added the wasmtime:debugging label to Issue #14062.
Last updated: Aug 30 2026 at 09:07 UTC