how to debug wasm
Hi,I am trying to add a UI plugin for my business and it is necessary to modify trace_processor to support user-defined data;So,I try to debug trace_processor.wasm file in Chrome browser by DevTools, but after add --debug option in run-dev-server script and re-run it,the output trace_processor.wasm.map is empty and the brower cannot recognize it either. The run-dev-server is modified to the following:
- $UI_DIR/node $UI_DIR/build.js --serve --watch --debug "$@"
The content of trace_processor.wasm.map is: {"version":3,"sources":[],"names":[],"mappings":""}
Is debugging wasm files through a browser a suitable way? What method do you usually use for debugging during development? Why is the content in the wasm.map file empty?
As the main developer of trace processor, my workflow is to not use wasm to debug at all. It's both slow to compile and also has a poor developer experience (maybe it's our configuration but it's also not something we've invested in improving because see below)
Instead use the native trace processor shell binary, use --httpd flag and make the UI connect to it. Then you can use all the normal tools to debug native programs (gdb, lldb, printf etc).