How would you build a Time Travel Debugger?
I've been looking at the idea of developing a Time Travel Debugger utility.
It would take a debug target and have a few options such as stack depth and disclude system code.
The debugger would either be started from an external tool, or triggered from a line of code inserted into a method that I want to record.
The debugger would execute the code from start to end and record the full stack on each step to the configured depth.
A visualisation tool would provide a set of controls to play the recording forwards and backwards and provide various ways to search and jump to points in the recording.
The idea is that the TTD code be added at the start of CSP pages or async processes where time itself is an important factor, or where its fiddly to attach a debugger.
I already have a stack record method which is able to take a very detailed snapshot of the stack and record it as a single JSON object.
The next stage is to figure out which are the best ways to start a debugger and step through the process. For a code triggered TTD I started to look at using system events to pause a process, job of a debugger process and restart the process, but it wasn't doing what I expected.
I've been experimenting with the %Studio.Debugger and %Debugger.System classes, but realise that I am scrabbling around in the dark a little with these classes.
I was hoping someone had any developer notes, a reference implementation or any advice to speed up these efforts?