Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backtrace support #150

Merged
merged 11 commits into from
Oct 21, 2024
Merged

Add backtrace support #150

merged 11 commits into from
Oct 21, 2024

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