-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Integrate interpreter frames into backtraces
Before: ``` julia> let error() end ERROR: Stacktrace: [1] error() at ./error.jl:44 ``` After: ``` julia> let error() end ERROR: Stacktrace: [1] error() at ./error.jl:44 [2] macro expansion at REPL[0]:2 [inlined] [3] In toplevel scope ``` The extra `macro expansion` frame is a pre-existing julia bug (#23971) that this PR doesn't address. The mechanism used here is to add a no-inline enter_interpreter stack frame that has a known stack layout (since it only has one local variable) and can thus be used to retrieve the interpreter state. I do not believe that this is guaranteed by the C standard, so depending on the whims of the compiler we may have to eventually write this function in assembly, but it seems to work well enough for now. One significant complication is that the backtrace buffer may now contain pointers to gc-managed data, so we need to make the gc aware that and can't be as non-chalant about copying the buffer around anymore.
- Loading branch information
Showing
10 changed files
with
411 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.