Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Debugging Emscripten builds #40

Open

Description

@tiran

It's tricky to debug emscripten builds. By default emcc strips all debug symbols and even function names from WASM files. I got some promising results with debug builds, source map, and Chromium DevTools.

  • Configure with --with-pydebug
  • Extend PY_LDFLAGS_NODIST var with -gsource-map --source-map-base http://localhost:8000/builddir/host/
  • emmake make -j8 python.html
  • Run python3 -m http.server from the cpython base directory (not the directory where python.html lives).
  • open http://localhost:8000/builddir/host/python.html
  • Use Chromium with C/C++ DevTools Support (DWARF) support and WebAssembly Debugging: Enable DWARF support.

Screenshot_20220105_171125

Activity

  1. tiran commented on Jan 5, 2022

    @tiran
    CollaboratorAuthor

    Source map does not require a debug build. A standard build of Python includes sufficient DWARF symbols to generate a source map:

    $ emmake make python.html BUILDPYTHON= LDFLAGS="-gsource-map --source-map-base=http://localhost:8000/builddir/host/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions