最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is the principle of "Time Travel Debugger"? - Stack Overflow

programmeradmin4浏览0评论

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:

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./mattgodbolt/piler-explorer

Share Improve this question edited Oct 8, 2017 at 14:01 Stephen.W asked Feb 8, 2017 at 3:13 Stephen.WStephen.W 2,1271 gold badge15 silver badges19 bronze badges 7
  • 5 Is your teacher a fan of Dr. Who, perhaps? "Time Travel Compiling" is not a standard term. It seems like a phrase that they coined. You could ask them what they mean by it. – John Coleman Commented Feb 8, 2017 at 3:16
  • It's about being able to set a breakpoint in a debugger and then step backwards through statements to see the state of the runtime environment at points before the breakpoint. – Pointy Commented Feb 8, 2017 at 3:23
  • And it doesn't really have a whole lot to do with pilers, really; it's a runtime system thing. Well, I guess a piler could generate code to maintain some sort of audit context, but that seems like a really weird way of doing things. – Pointy Commented Feb 8, 2017 at 3:24
  • 1 Of interest: OCaml - The debugger (ocamldebug) OCaml also has time travel debugging. – Guy Coder Commented Feb 8, 2017 at 12:03
  • 1 Of interest: Visual Studio IntelliTrace – Guy Coder Commented Feb 8, 2017 at 19:32
 |  Show 2 more ments

2 Answers 2

Reset to default 13

This is most monly 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 piling these languages (yes, they are piled) involves some interesting concepts.

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

Have fun with the project.

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 plete debugging process. it's all real-time and pretty efficient.

I've used this feature in Visual Studio.

发布评论

评论列表(0)

  1. 暂无评论