Skip to content
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

Add support for module names in wasm binaries #1010

Open
dschuff opened this issue May 11, 2017 · 2 comments
Open

Add support for module names in wasm binaries #1010

dschuff opened this issue May 11, 2017 · 2 comments

Comments

@dschuff
Copy link
Member

dschuff commented May 11, 2017

Basically implement WebAssembly/design#1055. We want binary parser and output support for it, and also asm2wasm/s2wasm support, which IMO should be independent of other debug info so that we can just use it all the time in emscripten (i.e. modules always have module names even if they have no function or local names). The cost of that will be very low, and it will be very useful for debugging and stack traces, especially along with WebAssembly/design#1053

@dschuff
Copy link
Member Author

dschuff commented May 11, 2017

cc @jgravelle-google and @kripken in case I don't get to it.

@jfbastien
Copy link
Member

Looks like you didn't get to it?

hubot pushed a commit to WebKit/WebKit-http that referenced this issue Jul 5, 2017
https://bugs.webkit.org/show_bug.cgi?id=172008

Reviewed by Keith Miller.

Parse the WebAssembly module name properly, and skip unknown
sections. This is useful because as toolchains support new types
of names we want to keep displaying the information we know about
and simply ignore new information. That capability was designed
into WebAssembly's name section.

Failure to commit this patch would mean that WebKit won't display
stack trace information, which would make developers sad.

Module names were added here: WebAssembly/design#1055

Note that this patch doesn't do anything with the parsed name! Two
reasons for this: module names aren't supported in binaryen yet,
so I can't write a simple binary test; and using the name is a
slightly riskier change because it requires changing StackVisitor
+ StackFrame (where they print "[wasm code]") which requires
figuring out the frame's Module. The latter bit isn't trivial
because we only know wasm frames from their tag bits, and
CodeBlocks are always nullptr.

Binaryen bug: WebAssembly/binaryen#1010

I filed #174098 to use the module name.

* wasm/WasmFormat.h:
(JSC::Wasm::isValidNameType):
* wasm/WasmNameSectionParser.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants