A whirlwind introduction to the challenges of recording native code and how to overcome them.
Introduction
Like any good idea in computer science, record & replay debugging dates back to the 1960s. Robert Balzer's Extendable Debugging and Monitoring System (EXDAMS) is quoted as the earliest system to implement the idea. EXDAMS worked by capturing dynamic events like function calls, branches, and variable assignments to a history tape. Replay could then restore any program state by applying the deltas from the tape.
Nowadays, with millions of function calls and billions of variable assignments per second, such an approach would clearly be infeasible. That's why modern implementations are based on one key insight: Computers are (mostly) deterministic. If you save which program you executed and what inputs you passed to it, it will (mostly) perform the same function calls and variable assignments again i