What is Time Travel Debugging?


5 minute read


Time travel debugging is the ability to wind back the clock to any point in an application’s execution and see exactly what it was actually doing. Simple or intricate bugs can all be diagnosed much faster; and it is a powerful way for developers to learn about and navigate an unfamiliar codebase.

The process: record once, debug anytime anywhere

Step 1: RECORD 

Record the execution of a program (down to instruction level) as it fails, and capture bugs in the act. The output – a recording – provides developers with all the data they need to understand what happened, without wasting days or weeks trying to reproduce the issue. 

Step 2: REPLAY 

Replay the recording forward and backward – at anytime and on any machine – to diagnose the root cause of the issue. Replay can be likened to "winding the tape" back and forth in real time in order to get a clear picture of a program's execution.


Resolve bugs faster and with more predictability.

Time travel debugging - infographic 1921x1081

Equipping developers with 6 new superpowers

 Time travel debugging equips developers with 6 new superpowers:

  1. Go back to any point in your application's execution history and inspect the complete state of the application at that point in time, including the contents of all variables and the heap.
  2. Use the full range of debugger functionality to navigate your application’s execution: stepping, running, breakpoints, watchpoints, catchpoints, etc., but in reverse as well as forward. This is called reverse debugging.
  3. Navigate through your application’s execution history in ways simply not possible in a conventional debugger: e.g. spot a line of interest in a log file, then jump inside a recording to the point in time when the application emitted that log line, or jump to the previous time the application made a particular system call.
  4. Query (rather than debug) your application’s behavior. For instance, add new logging statements to the source code and see the results instantly, without having to rebuild and redeploy the application.
  5. Replay a recording of your program’s execution taken from a failed CI or QA run. The application’s behavior is 100% reproducible each time the recording is replayed – even if it’s days or weeks later.
  6. Collaborate with other developers by sharing bookmarks and comments at points in time in these recordings.

Types of bugs time travel debugging helps resolve

Time travel debugging is best suited for:

  • Bugs where time passes between the bug occurring and the symptoms presenting themselves, i.e. assertion failures, segmentation faults, or simply unexpected behavior.
  • Bugs which occur intermittently or sporadically, i.e. a bug that occurs one time in a thousand, or occurs in a different way on each run of the program. Bugs tend to manifest in this way when the program’s execution is non-deterministic due to multithreading and/or interaction with other processes and services. 

Most race conditions fall into one or both of these cases; so do many memory or state corruption bugs and non-trivial memory leaks.

Time travel debugging in the development workflow

 Time travel debugging enables software development teams to create better software faster, and to fix customer issues more quickly. It can be deployed at any point in the software development lifecycle, whether in development, test, or production.

Where and how time travel debugging is deployed depends on the specific needs of the development team. The common thread throughout is the ability to obtain all the data needed to quickly resolve software failures.

    Time travel debugging in CI/CD

    LiveRecorder brings time travel debugging to CI, enabling C/C++, Go, and Java software teams to easily and quickly diagnose the root cause of new regressions, legacy bugs, and flaky tests.

    LiveRecorder takes the pain out of debugging:

    1. Capture the recording of an application failing under test (however intermittently) and it becomes 100% reproducible.LiveRecorder record CI test failures
    2. Launch a ready-to-go debug session in your browser with a one-click workflow: jump from a test failure (or bug report) straight into a replay of the recording that captured the bug. 
      One click workflow no title
      One click from failed test to the recording that captured the bug
    4. Time travel debug the recording to easily navigate the codebase, understand what happened, rapidly locate the root cause of issues, and fix defects coming out of CI faster and with 100% certainty.
    time travel debugging buttons in VS Code

    LiveRecorder enables software teams to significantly improve developer productivity and code quality. Developers can not only save a huge amount of time on debugging, but also fix known bugs before they hit customers.

    LiveRecorder vs. alternative methods for debugging test failures

    1. A systematic, repeatable debugging workflow, making bug fixing more predictable
    2. A guaranteed solution for capturing intermittent bugs that cannot be caught any other way
    3. A dramatically improved developer experience during debugging, increasing developer productivity and job satisfaction
    4. Effective asynchronous collaboration when working on bugs across teams and time zones (share recordings, add comments, etc.) 
    5. Full visibility into what the software is doing, enabling new team members to rapidly get productive on unfamiliar source code (to familiarise themselves with the current implementation or to debug issues) and helping to reduce onboarding time

    Learn more about LiveRecorder