explaingit

rr-debugger/rr

10,495C++Audience · developerComplexity · 4/5Setup · moderate

TLDR

A Linux debugging tool that records a program's exact execution once and lets you replay it as many times as needed with full gdb support, including the ability to step backwards through time.

Mindmap

mindmap
  root((repo))
    What it Does
      Records execution
      Replays precisely
      Reverse stepping
    Compatibility
      Linux only
      Intel AMD ARM
      gdb integration
    Key Features
      Time-travel debugging
      Reverse execution
      Crash reproduction
    Origin
      Mozilla created
      Pernosco sponsors
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Record a flaky test that crashes only occasionally, then replay the exact failure under gdb to find the root cause without having to reproduce it again.

USE CASE 2

Step backwards through a program's execution in gdb to find the exact line where a variable got corrupted or a bad value was introduced.

USE CASE 3

Capture a hard-to-reproduce production crash in a recording and share the file with a teammate so they can investigate it locally using gdb.

USE CASE 4

Use rr with Pernosco to get a collaborative debugging session where multiple people can explore the same execution recording together.

Tech stack

C++Linuxgdb

Getting it running

Difficulty · moderate Time to first run · 30min

Linux only and requires an Intel CPU from 2010 or later, certain AMD processors, or certain ARM chips, Xen VMs are not supported.

In plain English

rr is a debugging tool for Linux programs that records what a program does while it runs, then lets you replay that exact execution later. This matters because many bugs are difficult to reproduce: they appear only under specific timing conditions or after long periods of running. With rr, you record the program once, capturing its behavior precisely, and then you can replay that recording as many times as you like to investigate what happened. The replay is not just a log of output. rr integrates with gdb, the standard Linux debugger, and during a replay session you can pause, step through code, inspect variables, and also step backwards through time. This reverse-execution capability is the core feature. If you see a crash or a bad value, you can run the execution in reverse to find the exact moment the problem was introduced, rather than guessing and re-running repeatedly. rr runs on Linux and requires an Intel CPU from 2010 or later, certain AMD processors, or certain ARM chips such as Apple Silicon. It can run inside a virtual machine if the VM is configured to expose hardware performance counters (VMware and KVM work, Xen does not). It does not currently support Windows or macOS as the host operating system. The project was originally created by Mozilla and is now sponsored by Pernosco, a company that builds a commercial debugging service on top of rr technology. The README for this repository is brief and directs readers to the project website at rr-project.org and a technical research paper for deeper documentation.

Copy-paste prompts

Prompt 1
Walk me through using rr to record a crashing Linux C++ program, then replay the recording in gdb and step backwards to find where the crash originates.
Prompt 2
My C++ program has a bug that only appears after running for several hours. Show me how to use rr to record a long run, then use reverse execution in gdb to trace back from the crash point.
Prompt 3
How do I install rr on Ubuntu and verify that my Intel CPU and kernel are compatible with it? What should I check if it fails to record?
Prompt 4
I want to use rr inside a VMware virtual machine. Walk me through the configuration steps needed to expose hardware performance counters so rr can run inside the VM.
Prompt 5
Explain time-travel debugging in plain terms using rr as the example, then show me the gdb commands for reverse-stepping, reverse-continuing, and setting reverse watchpoints.
Open on GitHub → Explain another repo

← rr-debugger on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.