function and variable names in wasm

19 views
Skip to first unread message

craste...@gmail.com

unread,
Feb 10, 2021, 6:35:34 PM2/10/21
to emscripten-discuss
When I try to debug a problem in the wasm code in a browser (Chrome, Win10, 64bit) the browser's debug window shows me the code.  But the names are all replaced with things like "func513" and "var2".   Is there a flag that I can pass to emcc to ask it to build with the original names?

Also, I noticed that the code view window in the browser will only show up to 5000 or so lines of code.  After that, they just say "..."  Is there a way to change that?

Sam Clegg

unread,
Feb 15, 2021, 5:52:02 PM2/15/21
to emscripte...@googlegroups.com
The normal `-g` flag should be enough.  Or you can use the more specific `--profiling-funcs` flag to just get the function names (which should me fast to build).   That just gives you function names though.  If you want variable names you will need try the recently added support for DWARF.   (google "emscripten dwarf debugging" for more on that).     However just having function names is often a good start an very simple to enable.

cheers,
sam

On Wed, Feb 10, 2021 at 3:35 PM craste...@gmail.com <craste...@gmail.com> wrote:
When I try to debug a problem in the wasm code in a browser (Chrome, Win10, 64bit) the browser's debug window shows me the code.  But the names are all replaced with things like "func513" and "var2".   Is there a flag that I can pass to emcc to ask it to build with the original names?

Also, I noticed that the code view window in the browser will only show up to 5000 or so lines of code.  After that, they just say "..."  Is there a way to change that?

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/369fe4dc-2090-4353-9ecc-754481fb0fa3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages