[Lldb-commits] [lldb] [lldb] Resolve WebAssembly shadow-stack locals against the frame base (PR #211700)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 24 07:50:07 PDT 2026
JDevlieghere wrote:
> > but some architectures express it relative to the frame base without DW_OP_fbreg
>
> Is this valid DWARF though? Should we just fix the producer instead?
When I put up the PR I thought the answer was yes, but your question prompted me to dig a little deeper.
> Is this valid DWARF though?
Apparently not. Per the standard, a variable's DW_AT_location is a self-contained expression evaluated with an empty stack. I couldn't find anything that states otherwise for Wasm specifically.
> Should we just fix the producer instead?
Yes. LLVM emits two different encodings depending on whether the frame base ends up in a Wasm:
```
DW_AT_frame_base (DW_OP_WASM_location 0x0 0x0, DW_OP_stack_value)
DW_AT_location (DW_OP_fbreg +11)
```
```
DW_AT_frame_base (DW_OP_WASM_location 0x3 0x0, DW_OP_stack_value)
DW_AT_location (DW_OP_plus_uconst 0xf)
```
I think it's just an oversight. I will put up a PR.
https://github.com/llvm/llvm-project/pull/211700
More information about the lldb-commits
mailing list