-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
DWARF Sourcemaps #8934
Comments
cc @yurydelendik for the latest status here. |
The emscripten relies on binaryen to perform additional code section transforms, such as optimization. The transforming debug information is a hard task, and requires changes in all DWARF sections (not just .debug_line). I started the https://github.com/yurydelendik/wtmaps-utils project to experiment with that, and it is still work in progress. The idea is to record address spaces transforms, starting from identity source maps (I define that as a "transform") that is generated just after clang creates .wasm. This transform needs to be used with all binaryen passes. And, finally, combine the resulting transform and the initial DWARF to produce the DWARF usable with wasm tools/debuggers. Everything in wtmaps-utils is a pilot code, and help is appreciated. |
Just wanted to check in what the current status is. If there is something minimal we can do, just to get line information, even if we need to disable some binaryen passes that would already be enormously helpful. |
Regular sourcemaps are what works right now. DWARF sourcemaps depend on WebAssembly/binaryen#2400 which I am working on with @yurydelendik. Specifically, the avenue of using his wtmaps project as a solution is being explored, and emscripten has a |
Chrome recently posted a blog post about DWARF in WASM, if you guys are interested: https://developers.google.com/web/updates/2019/12/webassembly |
I guess this can be closed now since |
That support is not 100% stable, but yes, there are no currently open bugs so I guess we can close this bug. The initial work has all landed. |
Firefox supports reading source mapping information directly from the DWARF section in a .wasm file (in fact, it supports that better than regular source maps). Upstream LLVM is already capable of emitting this information and in fact it appears that if debugging information is enabled, emscripten even links the .debug_line section into the final wasm file. In theory, making firefox use this information is as simple as setting the sourceMapUrl section to the wasm file that contains the .debug_line section, though I haven't yet managed to successfully do this with an emscripten-generated .wasm file. Another wrinkle is that binaryen would likely have to be taught to update the debug_line section the same way it updates the regular source map now. In any case, it would be nice to have an emscripten option to use the DWARF directly rather than generating source maps.
The text was updated successfully, but these errors were encountered: