Qt, Linux and everything: Debugging Qt WebAssembly
2 days ago
- #Qt
- #webassembly
- #debugging
- Debugging Qt WebAssembly is easiest by configuring with -g argument or CMAKE_BUILD_TYPE=Debug.
- Emscripten embeds DWARF symbols in wasm binaries, but debugging with DWARF works only in Chrome with a specific extension.
- For browsers like Safari or Firefox, or if extensions aren't an option, source maps are needed.
- DWARF debugging requires enabling in browser developer tools settings but doesn't need source directory symlinks.
- Emscripten automatically embeds DWARF symbols in binaries built with -g, making Qt or application rebuild in debug mode sufficient.
- Qt's default debug builds use -g2 for optimization; -g or -g3 is needed for full debug symbols.
- Debugging with DWARF allows stepping through code similarly to desktop application debugging.