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

The WebAssembly debugging format is incompatible with its text format. #20

Open
7ombie opened this issue Dec 24, 2021 · 1 comment
Open

Comments

@7ombie
Copy link

7ombie commented Dec 24, 2021

The current DWARF for WebAssembly spec requires that instruction addresses are offsets into the Code Section. However, (extended) constant expressions contain instructions that are executed at runtime (and can contain errors), but their instructions are not encoded in the Code Section.

If I understand correctly, DWARF allows us to optionally specify which memory each instruction is stored in (by index). Presumably, that feature could be repurposed to reference section IDs instead. Given that the zero section ID is used for custom sections (so it cannot unambiguously identify an individual section), zero (in this context) could be mapped to the Code Section, so that section remains the default.

To be honest, I'm just beginning to learn about DWARF, so don't understand it very well yet. In any case, it should be possible to debug the text format with the debugging format.

WABT would ideally implement DWARF support in wat2wasm, and source languages operating at the same level of abstraction really need to support DWARF (if DWARF is all that browsers understand). I'm personally working on a source language that's basically WAT with whitespace and sugar, and there have been other alt-wat source languages in the past. None (except WAT) have achieved any real adoption, but it should at least be possible to debug these languages.

@7ombie
Copy link
Author

7ombie commented Jan 20, 2022

It's been a month now, and I cannot add debugging to my language without this.

I'm happy to be patient, but please at least respond.

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

No branches or pull requests

1 participant