Repository navigation
feat: support basic webassembly debugging - #1791
Merged
Merged
Conversation
Supports viewing, stepping through, and setting breakpoints in webassembly (decompiled as WAT) in the editor. Includes a basic tmLanguage for WAT.  Unfortunately we eagerly have to decompile WASM in order to get line mappings to show e.g. in breakpoints. Location mapping is currently mostly synchronous and I didn't want to make everything async for webassembly. However, we don't keep the WAT source in memory, instead request it again if it's needed. I opted to do this to reduce memory usage for user applications that just happen to contain WASM where they aren't always interested in debugging it. For #1789 Fixes #1715 on the way
Connor Peet (connor4312)
enabled auto-merge (squash)
August 25, 2023 22:26
Connor Peet (connor4312)
disabled auto-merge
August 25, 2023 22:36
| // If we see we want to set breakpoints in file by source reference ID but | ||
| // it doesn't exist, they were probably from a previous section. The | ||
| // references for scripts just auto-increment per session and are entirely | ||
| // ephemeral. Remove the reference so that we fall back to a path if possible. |
Member
Author
There was a problem hiding this comment.
This is no longer the case, and caused problems. Since a few years ago, we set the source referenced based on a hash of the URL and other information to try to make them stable between reloads, so we should leverage that information.
roblourens
approved these changes
Aug 26, 2023
roblourens
left a comment
Member
There was a problem hiding this comment.
Wat... 😁
I just wonder whether the wat grammar should be in this extension or in the builtin javascript extension, or its own builtin extension
Robo (deepak1556)
approved these changes
Aug 26, 2023
Member
Author
|
I think having it be built-in is sensible. I'll move it over on Monday. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supports viewing, stepping through, and setting breakpoints in
webassembly (decompiled as WAT) in the editor. Includes a
basic tmLanguage for WAT.
Unfortunately we eagerly have to decompile WASM in order to get line
mappings to show e.g. in breakpoints. Location mapping is currently
mostly synchronous and I didn't want to make everything async
for webassembly. However, we don't keep the WAT source in memory,
instead request it again if it's needed. I opted to do this to reduce
memory usage for user applications that just happen to contain WASM
where they aren't always interested in debugging it.
For #1789
Fixes #1715 on the way