Literally months late, but I'm also interested. I also noticed another issue with using -g4. It appears the source-map does not take into account the output directory. That is, if I output the build results somewhere other than where I ran the build command, the source paths seem to become invalid.
So this works: ./emcc tests/hello_world.c -g4 -o a.html --source-map-base file:///(path_to_emsdk)/emscripten/1.38.13/ However, in my experience this would not: mkdir build_results ./emcc tests/hello_world.c -g4 -o build_results/a.html --source-map-base file:///(path_to_emsdk)/emscripten/1.38.13/build_results/ There might be a very simple extra flag I could add to fix this that I'm not aware of. Also, this --source-map-base flag seems necessary for the browser to find the map (whether you're on localhost or just using file:///) despite it having not apparently been mentioned in here. On Thursday, April 11, 2019 at 2:15:52 PM UTC-4, Charles Vaughn wrote: > > At Tableau, what we've done is very similar to what Floh mentioned, but > baked into our tooling. It's probably not for everyone, since we require > calls into WASM be asynchronous, and Javascript access WASM's heap in a > serializable way. From those restrictions, we're able to use a python > server that loads a native version of our WASM, and exposes our methods via > a REST interface. We even support native executing Javascript through > Chrome's remote debugging protocol. > > If there's interest keeping in mind those restrictions, I can look into > sharing source. > > On Friday, April 5, 2019 at 1:28:58 PM UTC-7, Alon Zakai wrote: >> >> Yeah, debugging is definitely one of the bigger missing pieces here. This >> will hopefully improve soon in toolchains and browsers, there is ongoing >> work on it. Meanwhile debugging a parallel native build is often best, as >> mentioned. >> >> On Thu, Apr 4, 2019 at 8:56 PM Александр Гурьянов <[email protected]> >> wrote: >> >>> Agree, I never debug emscripten output. Source map never works for big >>> code bases. So all bug fixing done by playing with C++ native build, >>> in hope that it will be ported 1:1, actually it's almost true. >>> >>> пт, 5 апр. 2019 г. в 03:28, Brian Gavin <[email protected]>: >>> > >>> > My experience with source maps is similar to Floh. Kind of works for >>> very simple hello world apps but even then there are some lines I can not >>> set breakpoints. No variable inspection. Stepping into and out of >>> functions does not always work. >>> > >>> > Unfortunately my debugging technique is lots of prints and dump >>> callstack. You need to plan for development time to take longer then a >>> regular C++ application. >>> > >>> > Better debugging is my number 1 feature wish. >>> > >>> > Brian Gavin >>> > >>> > -- >>> > 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 [email protected]. >>> > For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> 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 [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/d146c593-0bcb-40c1-851e-2b60f66bc56d%40googlegroups.com.
