Skip to content

Commit 8dbbb67

Browse files
committed
Update opt-trace-format.md
1 parent 16b8d81 commit 8dbbb67

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎v3/docs/opt-trace-format.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ The `event` field can either be:
749749
- `call` - first line during an executed function call; very important to match with corresponding `return` for visualization to work properly ... every frame should have matching `call` and `return` entries.
750750
- `return` - about to return from a function, usually the `__return__` value is set at this point in the proper stack frame entry.
751751
- `exception` and `uncaught_exception` - when an exception happens - the `exception_msg` field should be set to a reasonable error message. use `uncaught_exception` at the top-level of the tracer to indicate what happens when the user's program itself didn't catch the exception, and a regular `exception` when the user's program throws an exception (which might be caught in another part of their program). If the trace has exactly 1 entry and it's an `uncaught_exception`, then the OPT frontend doesn't switch to the visualization at all ... instead it displays a "syntax error"-like thingy in the code editor. It will highlight the faulting line, indicated by the `line` field and display `exception_msg` there. So if you want to indicate a syntax error, then create a trace with exactly ONE entry that's an `uncaught_exception`. (If there's more than one trace entry and the last one happens to be `uncaught_exception`, then OPT will display the visualization as usual and then show the error when the user navigates to the final execution point.)
752+
- `instruction_limit_reached` - if you want to cap execution at a certain limit (e.g., 300 executed steps), issue this special event at the end. fill in the `exception_msg` field to say something like "(stopped after N steps to prevent possible infinite loop)"
752753

753754

754755
## Closures and Zombie Frames (advanced)

0 commit comments

Comments
 (0)