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
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to