Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the principle of "Time Travel Debugger"?

Hmm... My teacher, some of my classmates and I are going to build a Debugger project. We hope that our debugger is interactive, that is, when codes are typed in, the result will be displayed somewhere few seconds later, and the result changes while the input code changes. On the other hand, while running, we can rollback to the former line or breakpoints.

In accordance with my teacher's word, the technique "Time Travel Debugging" will be involved while programming. I searched some project that maintained by others but I can poorly understand the code and there are no introductions about this technique in any of those README files.

reference: https://github.com/mattgodbolt/compiler-explorer

like image 896
Stephen.W Avatar asked Feb 08 '17 03:02

Stephen.W


People also ask

What is time travel debugging react?

Time travel debugging refers to the ability step forward and backward through the state of you application, empowering the developer understand exactly what is happening at any point in the app's lifecycle.

How Redux time travel works?

The Redux DevTools records dispatched actions and the state of the Redux store at every point in time. This makes it possible to inspect the state and travel back in time to a previous application state without reloading the page or restarting the app.

How do you use IO replay?

Simply open the Replay browser, then go to the page you want to record. Record and press save. Share with your teammates via links.


2 Answers

This is most commonly known as "time travel debugging", and is often associated with "Functional Reactive Programming". (Those are terms which you can easily search.) There are some reasonably accessible documents on the Elm Language blog (for example, time travel made easy), but I'd suggest you start at the beginning rather than diving into the middle and having to time travel your understanding (some pun intended :-))

Strictly speaking, time travel debugging is something that happens at runtime, but it is much easier if you are programming in a functional language (such as Haskell, Elm, OCAML, or various others, for which time-travelling debuggers have been implemented), and compiling these languages (yes, they are compiled) involves some interesting concepts.

Elm compiles to javascript, which makes it relatively easy to experiment with.

Have fun with the project.

like image 156
rici Avatar answered Oct 21 '22 03:10

rici


Time travel debugging is also known as reverse debugging. In layman terms, you can debug the same lines again and again (without stopping/restarting the app).

For example, you're debugging a method which threw an exception at line 10, to find the cause of exception you can again execute that method from a prior point let's say line 4 without restarting the complete debugging process. it's all real-time and pretty efficient.

I've used this feature in Visual Studio.

like image 34
GorvGoyl Avatar answered Oct 21 '22 05:10

GorvGoyl