-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: Record function names in panic
Currently, yaegi only records source positions when writing panic trace to stderr. This change adds function names to the panic output. Unfortunately, yaegi walks the trace in reverse order, comparing to Go runtime. This can be improved in the future.
- Loading branch information
Showing
3 changed files
with
62 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
func main() { | ||
foo() | ||
} | ||
|
||
func foo() { | ||
bar() | ||
} | ||
|
||
func bar() { | ||
baz() | ||
} | ||
|
||
func baz() { | ||
panic("stop!") | ||
} | ||
|
||
// Error: | ||
// stop! |
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