llvm-c166/lldb/docs/resources
Jonas Devlieghere 0e011c4f00
[lldb] Scope Wasm global reads to a module instance (#213176)
A Wasm global belongs to a module instance, not to a frame. The global
index space is per instance, and `DW_OP_WASM_location`'s global operand
indexes the index space of the instance whose code is being evaluated,
so two instances of one module have separate globals. `qWasmGlobal`
takes a frame index instead, which leaves a global of an instance with
no active frame out of reach.

Name the instance instead: `qWasmGlobal:<index>;instance:<id>;`. The id
is the module id LLDB already carries in bits 61:32 of a Wasm address,
so nothing has to be enumerated first. A stub opts in by advertising
`qWasmInstance+` in its `qSupported` response, which covers every Wasm
packet whose scope is an instance rather than a frame, so a query for
other instance-scoped state does not need a packet of its own. A stub
that does not advertise it keeps getting the frame form.

Linear memory needs no suffix: a Wasm address already carries the id of
the instance it points into, which the documentation now spells out
along with the object space tag a reported load address has to carry.
Every value the id field can hold names an instance, zero included, so
the sentinel for no instance lives outside the 30-bit id range.

Naming an address space explicitly, as #206370 proposes, is a separate
feature. This packet stays out of its way: `instance:` names an
instance, and a packet gated on address spaces would carry an address
space id in place of that suffix.

Fixes #212833
2026-08-21 08:32:19 -07:00
..
addinglanguagesupport.md
addingtargetsupport.md
build.md
caveats.md
contributing.md
dataformatters.md
debugging.md
extensions.md
formatterbytecode.md
fuzzing.md
lldbdap-contributing.md
lldbgdbremote.md
lldbplatformpackets.md
overview.md
projects.md
qemu-testing.md
sbapi.md
test.md