A method is disclosed for recording and replaying computer programs. In
one embodiment, a method of modifying a computer program to support
recording execution, comprises the computer-implemented steps of
receiving an executable application binary; modifying the executable
application binary by adding one or more proxy code elements to result in
creating a modified application binary, wherein upon execution of the
modified application binary, the one or more proxy code elements create
and store recorded information representing all non-deterministic events
that occur during the execution. For example, asynchronous callbacks and
thread context switches are recorded and can be replayed.