Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DW_OP_WASM_location is unsupported #544

Closed
RReverser opened this issue Jan 5, 2021 · 7 comments · Fixed by #546
Closed

DW_OP_WASM_location is unsupported #544

RReverser opened this issue Jan 5, 2021 · 7 comments · Fixed by #546

Comments

@RReverser
Copy link
Contributor

When trying to dwarfdump any Wasm file produced with latest Clang or Rust, DW_AT_frame_base looks like this:

DW_AT_frame_base            len 0x0007: ed03000000009f: WARNING: unsupported operation 0xed

Looks like Gimli needs to be taught DW_OP_WASM_location as described at https://yurydelendik.github.io/webassembly-dwarf/#DWARF-expressions-and-location-descriptions. /cc @yurydelendik

@yurydelendik
Copy link
Contributor

Yes, it will be nice to have Wasm DWARF support. At least under the feature. We are using crude hack in the wasmtime project.

@philipc
Copy link
Collaborator

philipc commented Jan 26, 2021

Are the semantics of this operation similar to DW_OP_regx (rather than DW_OP_bregx)?

@RReverser
Copy link
Contributor Author

@philipc I guess depends what you mean by semantics... The attached link likely explains it better than I could.

@philipc
Copy link
Collaborator

philipc commented Jan 26, 2021

Does it complete the expression or piece (as in DW_OP_regx), or does it push a value on the stack (as in DW_OP_bregx)? I assume it is the former. Would Wasm ever have a need for the later?

@RReverser
Copy link
Contributor Author

AFAIK it's the former, yes.

@philipc
Copy link
Collaborator

philipc commented Jan 27, 2021

So having implemented this in #546, I see that llvm is emitting a DW_OP_stack_value after it, which I think would only make sense if it pushed a value on the stack. @yurydelendik Can you take a look at this please?

@RReverser
Copy link
Contributor Author

So having implemented this in #546, I see that llvm is emitting a DW_OP_stack_value after it, which I think would only make sense if it pushed a value on the stack. @yurydelendik Can you take a look at this please?

Note that this is being fixed in https://reviews.llvm.org/D94347/new/, which also adds support for indirect values (0x02).

So DW_OP_WASM_location will be completing the expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants