Patent ID: 8090989

Claim:
A non-transitory computer readable medium having computer executable instructions for implementing a backwards debugger configured to implement a method of returning to a state in the history of execution of a computer program, said state comprising a set of values of one or more of registers of a processor on which the program is running, working memory space to which the program has access and operating system resources allocated to the program, the method comprising: identifying in machine code representing said program, instances of machine code instructions associated thread switch events; modifying said program machine code to execute a program instrumentation set of machine code instructions to handle said thread switch events; executing said modified program machine code, storing a time series of said states during said executing; restoring a said stored state; and executing said modified program machine code forward in time starting at said restored state to return to said state in said program history of execution; wherein said modifying comprises: partitioning said program machine code into a plurality of blocks each comprising a copy of a part of said program machine code and configured to execute said program instrumentation code after execution of the respective block; and replacing an instruction to an operating system to create a new thread with machine code to control creation and execution of said new thread; and wherein said control code counts a number of said blocks which have been executed to control said new thread execution.