webassembly-dwarf icon indicating copy to clipboard operation
webassembly-dwarf copied to clipboard

DW_TAG_subprogram and multiple return values

Open ggreif opened this issue 4 years ago • 1 comments

I think the return types are under-specified in the case that a WASM func returns more than one value (this is part of spec v1.1).

Let's assume we want to emit DWARF from wast2wasm:

  • when there are zero returns, omit the DW_AT_type
  • when one result emit DW_AT_type with that result type
  • when more than one result, ???.

One workaround that comes to my mind is emitting a synthetic tuple type, but maybe a proper solution should be worked out in cooperation with a future DWARF6 spec.

I am actually asking for ideas how to map multi-returns to DWARF5 and I am happy to provide input for discussion.

ggreif avatar Aug 31 '20 09:08 ggreif

One workaround that comes to my mind is emitting a synthetic tuple type, but maybe a proper solution should be worked out in cooperation with a future DWARF6 spec.

I think it is sensible do both. We want to introduce DW_TAG_ extension to be specific for Wasm multi-value return for sure, and per "7.1 Vendor Extensibility" of the standard it is an acceptable way.

yurydelendik avatar Aug 31 '20 15:08 yurydelendik