Reverse Debugging with GDB
sourceware.org
sourceware.org
Could debuggers please store the code paths and variable values, over the last 50 executions or perhaps the test suite (deterministic)? This is particularly useful for understanding someone else's code.
[edit: a context-free version of reverse debugging]
I've recently been enjoying using IntelliJ for Scala, because it can show me types, and jump to type declarations, and usages.
However, I still have to do a bunch of print debugging when trying to understand someone else's code, because I want to understand what values certain variables take. This is a pain using a compiler as slow as Scala.
Something that captured relevant information, so that it would be easier + faster to do print debugging against previous code runs or the test suite, would be awesome.
https://sourceware.org/gdb/wiki/ProcessRecord
the data may only be in-process, if so it would need to be save-able and load-able.
I'd never claim it's perfect: it's software after all, and the fact most software has bugs is why we have a business in the first place ;) But we're used by some pretty hardcore folk these days, including Cadence, NASA, and some of the biggest banks in the world. And the PyPy guys seem pretty happy :) Oh, and of course, if you do find issues, please do report them to support@undo-software.com -- then we can fix them.
I really like the idea. Never knew GDB had implemented it (thanks for the link!). I'll definitely try this out :)
VMWare had record-and-replay debugging functionality which was functionally similar to gdb's backwards debugging, although its implementation was a lot different, which allowed it to scale to recording much longer threads of execution. We used this at Mozilla to find a number of super-tricky bugs; it was pretty awesome. Unfortunately this feature was nixed in vmware workstation 8 [1].