Skip to content

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Oct 21, 2024

This PR adds minimal support to display backtrace for a trap with minimal performance overhead.

$ cat t.wat
(module
  (memory (export "memory") 1)
  (func $foo (result i32)
    unreachable
  )
  (func $bar (result i32)
    (call $foo)
  )
  (func (export "_start")
    (call $bar)
    (drop)
  )
)
$ wat2wasm --debug-name t.wat
$ wasmkit-cli run t.wasm
Error: Trap: unreachable
    0: foo
    1: bar
    2: _start

TODO

  • Show binary source offset (we need to build address map during the Translator pass)
  • Host/guest interleaving stack trace

@kateinoigakukun kateinoigakukun merged commit 19cfaf9 into main Oct 21, 2024
11 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/enhance-parser branch October 21, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant