December 25th, 2017

Time travel is here, at least when it comes to debugging

At CppCon 2017, the Time Travel Debugging team (TTD) came through with a present for all the developers out there: A reverse debugging tool!

Time Travel Debugging captures a trace of the program being executed so that the run can be replayed later. When you load the trace in the debugger, you can jump to any point in the program’s execution, be it forward or backward. Single-stepping backward through the code lets you trace backward where a bad value came from. You can set write breakpoints on memory and then ask the program to execute backward: The breakpoint will fire when the memory was previously written. Again, this lets you trace backward where a bad value came from.

(As noted in the talk, this is similar in many ways to the rr project, but differs in many was as well.)

Bonus chatter: I helped out with the replay portion of this project some time ago. I wrote the second version of the jitter’s register allocator, as well as implementing some of the opcodes. I’m told that some of my code has since been removed, but other parts remain.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.