-
Notifications
You must be signed in to change notification settings - Fork 483
Call trace for failing evaluation via new emitter mode #7178
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
Changes from all commits
823245f
76dd5d5
8713519
3fffc4d
4a17650
3fd918a
f96c900
3f402df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Added | ||
|
||
- Added a new emitter mode `logWithCallTraceEmitter` which uses trace messages generated by `PlutusTx.Plugin:profile-all` flag of plutus-tx-plugin to create call trace of the functions that led to the evaluation failure. If script passes or script is not compiled with `profile-all` flag, `logWithCallTraceEmitter` will behave as regular `logEmitter`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
func 1 | ||
-> nestedLinear (test/CallTrace/Spec.hs:71:1-71:12) | ||
-> nestedLinear2 (test/CallTrace/Spec.hs:72:1-72:13) | ||
-> nestedLinear3 (test/CallTrace/Spec.hs:73:1-73:13) | ||
-> nestedLinear4 (test/CallTrace/Spec.hs:74:1-74:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This encoding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from line 78 column 1 to line 78 column 4. this is what SrcSpan pretty printer does. I don't really want to change the pretty instance. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see!
🤣 I think that my mental parser trips over the
I suggested to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't change this without changing Just src -> nameStr <> " (" <> show (src ^. srcSpanIso) <> ")" I think this is okay honestly. This is standard format used by GHC(and other languages as well!), e.g. |
||
-> nestedLinear2 (test/CallTrace/Spec.hs:72:1-72:13) | ||
-> nestedLinear3 (test/CallTrace/Spec.hs:73:1-73:13) | ||
-> nestedLinear4 (test/CallTrace/Spec.hs:74:1-74:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> functionFromOtherModule (test/CallTrace/Spec.hs:93:1-93:23) | ||
-> $ | ||
-> errorWhenTrue (test/CallTrace/OtherModule.hs:9:1-9:13) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $cmyClassFunc (test/CallTrace/Spec.hs:99:3-99:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $cmyClassFunc (test/CallTrace/Spec.hs:99:3-99:13) | ||
-> functionFromOtherModule (test/CallTrace/Spec.hs:93:1-93:23) | ||
-> $ | ||
-> errorWhenTrue (test/CallTrace/OtherModule.hs:9:1-9:13) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $cmyClassFunc (test/CallTrace/Spec.hs:103:3-103:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $fMyClassInOtherModuleInteger_$cmyClassFuncInOtherModule (test/CallTrace/OtherModule.hs:19:3-19:26) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $fMyClassInOtherModuleInteger_$cmyClassFuncInOtherModule (test/CallTrace/OtherModule.hs:19:3-19:26) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> $fMyClassInOtherModule()_$cmyClassFuncInOtherModule (test/CallTrace/OtherModule.hs:23:3-23:26) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> func (test/CallTrace/Spec.hs:78:1-78:4) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> functionFromOtherModule (test/CallTrace/Spec.hs:93:1-93:23) | ||
-> $ | ||
-> errorWhenTrue (test/CallTrace/OtherModule.hs:9:1-9:13) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> nestedLinear (test/CallTrace/Spec.hs:71:1-71:12) | ||
-> nestedLinear2 (test/CallTrace/Spec.hs:72:1-72:13) | ||
-> nestedLinear3 (test/CallTrace/Spec.hs:73:1-73:13) | ||
-> nestedLinear4 (test/CallTrace/Spec.hs:74:1-74:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
An error has occurred: | ||
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'. | ||
Caused by: error | ||
|
||
Trace: | ||
-> nestedLinear (test/CallTrace/Spec.hs:71:1-71:12) | ||
-> nestedLinear2 (test/CallTrace/Spec.hs:72:1-72:13) | ||
-> nestedLinear3 (test/CallTrace/Spec.hs:73:1-73:13) | ||
-> nestedLinear4 (test/CallTrace/Spec.hs:74:1-74:13) | ||
-> error |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CPU: 4_513_072 | ||
Memory: 23_548 | ||
Term Size: 176 | ||
Flat Size: 530 | ||
|
||
No Trace Produced | ||
|
||
(con string "hi") |
Uh oh!
There was an error while loading. Please reload this page.