Skip to content

Support for emitting data that allows reconstructing original stack trace frames (including inlined frames) #8070

@mkustermann

Description

@mkustermann

The current support for source maps does not allow decoding stack traces in a way that preserves inlined frames. This is problematic as a stack trace from production may not make too much sense if important frames are missing.

At the minimum one would want to have a way to decode production stacks offline with a tool.
Better would be if this also worked nicely in the browser (especially for a world where compile-to-js languages start using compile-to-wasm-gc and may want to do that not only for production but also development use case)

There's a few options:

  • Make use of the fact that source maps is a json format which allows emitting extra (i.e. non-specified) information in it (this is the approach of dart2js).
  • Rely on DWARF instead of source maps. Currently binaryen disables some optimizations when dwarf mode is enabled. It's unclear if these optimizations have to be disabled if we only care about correct inlined frames in dwarf or they are disabled due to supporting other dwarf features.
    => See also Support for all optimization passes with DWARF output? #4814
  • Have a separate, generic mechanism that allows attaching metadata to things in the wasm file (instructions, globals, ...) and ensure the wasm2wasm optimizer preserves this information.

/cc @biggs0125 @osa1

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