Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Trace an evaluation with an interface that allows interactive debugging
ResourceFunction["TraceInteractive"][expr] evaluates expr in an interactive interface where each step of the evaluation can be inspected. | |
ResourceFunction["TraceInteractive"][expr,patt] sets patt as a breakpoint for entering subsessions. |
| CreateWindow | True | create a new window for tracing |
| NotebookClose | False | close the window when finished |
Retrieve the ResourceFunction:
| In[1]:= |
| Out[1]= |
Trace an evaluation and stop whenever addition occurs:
| In[2]:= |
| Out[2]= |

Additional breakpoints can be added during evaluation by clicking the + button to the right of the breakpoints:

To remove breakpoints, just click them in the list.
Now clicking Continue will stop on multiplication as well:

The Return button will complete the evaluation with no further interruptions:

The colored numbers on the left of each cell correspond to the current trace level of the evaluation:
| In[3]:= | ![]() |
| Out[3]= |

Use the current notebook instead of creating a new one:
| In[4]:= |

Automatically close the trace notebook when evaluation is complete (result is returned to the current notebook):
| In[5]:= |
| Out[5]= |
Enter a subsession when an error occurs to investigate the current Stack:
| In[6]:= | ![]() |
| Out[6]= |
| In[7]:= |
| Out[7]= |

Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License