-
Notifications
You must be signed in to change notification settings - Fork 267
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
Adds support for DWARF based stack traces #881
Conversation
Ok got the minimal PoC version has started working for interpreter!! next week refine it and will add support for compiler |
almost there on the compiler - the impl looks much more straightforward than I initially thought! |
thanks for not choosing something that would result in huge dwarf ;) |
ok passed on compilers as well. backfilling tests. |
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great to solve a highly demanded older issue!
only thing I'm worried about is if a module is compiled with the experimental flag on + compiler cache and ran with it off.. does it crash. visa versa also. Maybe add this to the tests.
|
||
type enableDWARFBasedStackTraceKey struct{} | ||
|
||
// WithDWARFBasedStackTrace enables the DWARF based stack traces in the face of runtime errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this invalidate or otherwise make complication cache tricky? ex if the cache was built with this off and used when on or visa versa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will do it in another pr
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
will add the support via compilation cache later |
This implements the support for DWARF-based stack traces. This new feature is enabled by
the experimental API
experimental.DWARFBasedStackTraceEnabled
and passing that contextto the runtime at compilation time.
For example, let's have the following program:
and use
experimental.DWARFBasedStackTraceEnabled
during the compilation:Now, instantiate the compiled module, which results in a runtime error:
and we have the output like the following:
from which we can easily infer how the execution reached the runtime error because the trace comes with the source code locations.
closes #58