-
Notifications
You must be signed in to change notification settings - Fork 6k
Improve Wasm Debugging. #41054
Improve Wasm Debugging. #41054
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
lib/web_ui/dev/build.dart
Outdated
| ); | ||
| argParser.addFlag( | ||
| 'dwarf', | ||
| help: 'Embed dwarf debugging info into the output wasm modules. This is' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/dwarf/DWARF/ (but keep the small case flag name)
lib/web_ui/dev/build.dart
Outdated
| ); | ||
| argParser.addFlag( | ||
| 'dwarf', | ||
| help: 'Embed dwarf debugging info into the output wasm modules. This is' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit2: add one space after "is" so it's not glued to "only" on the next line.
lib/web_ui/dev/build.dart
Outdated
| FutureOr<bool> run() async { | ||
| final bool embedDwarf = boolArg('dwarf'); | ||
| if (embedDwarf && runtimeMode != RuntimeMode.debug) { | ||
| throw ToolExit('Embedding dwarf data requires debug runtime mode.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DWARF
| // * /test/alarm_clock_test.dart | ||
| // * /lib/src/engine/alarm_clock.dart | ||
| .add(createStaticHandler(env.environment.webUiRootDir.path)) | ||
| .add(_createSourceHandler()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both _createSourceHandler and the previous handler attempt to handle .dart sources. Can't tell which one wins when.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out the first one is subsumed by the new one, so I removed the old one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we still need that static handler, because it serves specific files that the tests use, but it isn't for sources anymore, so I updated the comment.
lib/web_ui/dev/test_runner.dart
Outdated
| ) | ||
| ..addFlag( | ||
| 'dwarf', | ||
| help: 'Debug wasm modules using embedded dwarf data.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DWARF
| '--wasm-use-dwarf', | ||
| action='store_true', | ||
| default=False, | ||
| help='Embed dwarf debugging info in the output module instead of using ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DWARF
DEPS
Outdated
| # TODO(jacksongardner): This targets a commit that is not on the master branch. | ||
| # This needs to be removed before this PR lands, but this will allow us to verify | ||
| # these changes in CI. | ||
| 'src': 'https://github.com/flutter/buildroot.git' + '@' + '5adf0d1951587debc612831a285d765d8603dfbb', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder
mdebbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the debugging experience!
| "//third_party/icu/source/common/ustrtrns.cpp", | ||
| "//third_party/icu/source/common/utf_impl.cpp", | ||
| "//third_party/icu/source/common/utrie2.cpp", | ||
| "//third_party/icu/source/common/utypes.cpp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind explaining what these changes mean? I think I understand adding utypes.cpp. It's used in debug mode to show error messages.
What about static_library => source_set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utypes.cpp was because of a compile error I was getting when debugging, for the u_errorName_skia symbol. Changing from static_library to source_set was just something that is a holdover from when I was troubleshooting this issue. I think I can change it back.
Co-authored-by: Mouad Debbar <mouad.debbar@gmail.com>
|
auto label is removed for flutter/engine, pr: 41054, due to - This commit is not mergeable and has conflicts. Please rebase your PR and fix all the conflicts. |
|
auto label is removed for flutter/engine, pr: 41054, due to - This commit is not mergeable and has conflicts. Please rebase your PR and fix all the conflicts. |
Improve Wasm Debugging.
This PR makes some improvements to the debugging experience for built wasm modules (CanvasKit and Skwasm):
host.dart.jsfiles as well as any.wasmoutputs, if they are produced.--dwarfis passed to felt on the command line.This requires some buildroot changes as well, PR for that is here: Add some options to make wasm debugging work better. buildroot#710
One thing to note is that the sourcemap strategy doesn't currently work for CanvasKit. This is because the CanvasKit target specifies the
--source-map-baseto be the location inside node_modules for npm clients. I will follow up with the Skia team to try to change this behavior so that the sourcemap strategy works. However, DWARF debugging works for both CanvasKit and Skwasm.