Converts DWARF debug info to sourcemaps for browser debug tools
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
Standalone utility to generate sourcemaps from WebAssembly files.
How to install
First install a D compiler.
curl https://dlang.org/install.sh | bash -s or follow the instructions at https://dlang.org/download.html
Then you can run this tools with
dub run wasm-sourcemaps -- --help.
Make sure your WebAssembly file contains dwarf debug information.
Usage: wasm-sourcemaps [--help] [--output=<string>] [--embed=<bool>] [--embed-base-url=<string>] [--include-sources=<bool>] file Positional arguments: file Input file Optional arguments: --help, -h Prints this help. --output <string> Output file, default is same as input with '.map' extension added, use '-' for stdout --embed <bool> embeds the sourcemap url in wasm file. Default is true. This adds a sourceMappingURL custom section in the wasm file with a reference to the sourcemap file. This allows browsers to automatically load the sourcemap file. --embed-base-url <string> sets the url used when embedding the sourcemap url in the webassembly file. Default is './'. --include-sources <bool> includes the source files in the sourcemap. Default is 'false'.
How it works
It extracts dwarf debug information from the WebAssembly file and converts it to a sourcemap version 3.
D mixins aren't included in the sourcemap.
Sourcemaps themselves contain no type information so a debugger (e.g. browser devtools) will only show raw WebAssembly types (i32u, i32s, f32, f64).
Part of the dwarf code was taken from the elf-d project by Yazan Dabain. That code, as well as this project, is licensed under the Boost Software License, Version 1.0.
- Registered by Koppe
- 0.0.4 released 2 years ago
- Copyright © 2019, Sebastiaan Koppe
- darg, wasm-reader
0.0.4 2019-Nov-05 0.0.3 2019-Nov-05 0.0.2 2019-Nov-05 0.0.1 2019-Nov-05 ~master 2019-Nov-05
- Download Stats:
0 downloads today
0 downloads this week
1 downloads this month
21 downloads total
- Short URL: