Skip to content

Commit 1f90a29

Browse files
committed
Update opt-trace-format.md
1 parent 4da618f commit 1f90a29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ The `event` field can either be:
772772
- `step_line` - ordinary single step. most trace entries will be of this type.
773773
- `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.
774774
- `return` - about to return from a function, usually the `__return__` value is set at this point in the proper stack frame entry.
775-
- `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.)
775+
- `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 right now OPT *still* won't switch to the visualization and instead issue an error message. TODO: figure out what's a more desirable behavior here.)
776776
- `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)"
777777

778778

0 commit comments

Comments
 (0)