-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[dart2wasm] Better debugging support #55763
Comments
For fast turnaround during development of apps in Dart for web we recommend to use DDC. Dart2wasm is (similar to dart2js) for deploying apps. That being said if one has to debug issues that only happen with dart2wasm compiled apps, I can recommend using the Additionally we do plan on offering source maps support (@osa1 is working on it atm) |
That was exactly the issue, JS is running fine, but i got lots of issues after compling to wasm. Thanks for the info on the flags! |
If you run into any issues in our compilers, libraries etc, please don't hesitate to reach out! |
I am trying to build our Flutter application with wasm support: I am however getting this error:
Any ideas on how I can debug this? |
I'm going to close this in favor of the older #55229. |
This implements generating source maps for the generated Wasm files. Copying dart2js's command line interface, a source map file with the name `<program name>.wasm.map` is generated unless `--no-source-maps` is passed. When a source map is generated, the generated .wasm file gets a new section `sourceMappingURL` with the contents `<program name>.wasm.map`. This section seems to be undocumented, but Chrome and binaryen recognize it as the URI to the source map file. Chrome is then loads it automatically in the DevTools. - `wasm_builder` package is updated with the new `source_map` library, which describes the source mapping entries. - `wasm_builder`'s `InstructionsBuilder` is updated with the new public members: - `startSourceMapping`: starts mapping the instructions generated to the given source code. - `stopSourceMapping`: stops mapping the instructions generated to a source code. These instructions won't have a mapping in the source map. - `CodeGenerator` sets the source file URI and location in the file when: - Starting compiling a new member - Compiling an expression and statement Bug: #55763 Change-Id: Ieb24796b4b17a735b846793617664a453f1061ce Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/370500 Cherry-pick-request: #56239 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375660 Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
Add debugging capabilities to the dart tooling so we can easily debug wasm code, from within our IDEs.
There doesn't seem to be a good way to debug dart code that has been complied to wasm. I can set break points in the complied wasm code, but because there are no source maps this is quite useless, so i am back to debugging with strings.
The text was updated successfully, but these errors were encountered: