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

How to get Rune backtraces for native Results at runtime? #811

Open
VorpalBlade opened this issue Aug 18, 2024 · 1 comment
Open

How to get Rune backtraces for native Results at runtime? #811

VorpalBlade opened this issue Aug 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@VorpalBlade
Copy link
Contributor

When Rune's Vm::async_call returns a VmError you can get a nice backtrace using VmError::emit. However if you return custom Result<T, CustomError> from your native methods it doesn't seem there is a way to capture the Rune backtrace as far as I can tell?

I could consider sticking the backtrace in my custom error type if I knew how to capture it when returning from my native code for example.

This is either a request for a feature or request for improved documentation (the latter I would be willing to PR if you point me in the right direction).

@udoprog
Copy link
Collaborator

udoprog commented Aug 18, 2024

A backtrace for the current vm could be extracted (stack frames) with the caveats that:

  • It would require a dedicated instruction to extract.
    " It would not be able to peek through native functions, futures, and generators (vm execution stuff).
  • It would only provide rich diagnostics if debug info is available.

@udoprog udoprog added the enhancement New feature or request label Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants