Conversation
| ); | ||
| } | ||
| // https://docs.rs/gimli/latest/gimli/read/enum.Operation.html#variant.StackValue | ||
| // Commonly used for Wasm to terminate the expression. |
There was a problem hiding this comment.
I must admit I'm not familiar enough with DWARF and not sure about that.
My understanding is that Wasm emits something like this: DW_OP_WASM_location ..., DW_OP_stack_value. Where DW_OP_stack_value is used to terminate the expression. Does this make sense?
I'm curious why this seems to be specific to Wasm.
There was a problem hiding this comment.
It appears to me that this is because DW_OP_WASM_location is only an address for the case for where wasm-op is wasm-local-indirect. For the other wasm-op values, the semantics are that it pushes the value of the local/global/operand onto the DWARF stack, so the result of the expression must be an implicit stack value rather than a location description. In my view this is a strange design, but I don't have much to do with Wasm so I don't know the reasons.
So rather than adding a case for Operation::StackValue here, what you need to do is change the gimli::Operation::Wasm* support to push a value onto the stack instead of setting location.
Also, it looks like gimli needs to be updated to add gimli::Operation::WasmLocalIndirect. I'm happy for that to be done later though if you don't need it yet.
No description provided.