binaryen
binaryen copied to clipboard
Names section on the side
Right now we have --symbolmap
which emits a "symbol map" of indexes to function names. People normally run that, then strip the names and ship that binary. Then if a crash happens the function indexes in the crash can be used to reconstruct a full stack trace with names.
Another option is to save the wasm with DWARF and strip the DWARF from the shipping binary.
In a meeting just now some more ideas were raised by @dschuff and @tlively , documenting them here so we don't forget:
- We could store the entire wasm binary with the names section on the side. Instead of
--symbolmap
, just saving the original binary is simpler, and it would contain the full names section - not just functions. That is a little similar to DWARF, but using the names section. - The emsymbolizer tool in emscripten could be improved to work on such files.
- The emsymbolizer tool could run like c++filt and find all symbol-name-looking things and replace them in a given input string. That would allow more automatic reconstruction of stack traces.