Optimal program execution replay
AssigneeMicrosoft Corporation
InventorErnest Cohen
Life of this patent
Estimating the term…
Abstract
A method of replaying a recorded sequence of execution steps of a computer program or system to a selected target step while taking a minimal number of execution breaks includes calculating, for each of the steps, a predecessor step that can reached in a minimal number of execution breaks. The total calculation time for the entire execution is linear in the number of steps, and allows subsequent calculation of an optimal path to any selected step to be obtained in time linear in the length of the optimal path.
Claims12
A method for replaying a computer program execution up to a target step of the execution other than the initial step of the execution, the method comprising:
- calculating an optimal predecessor step of the target step, the predecessor step preceding the target step and from which the target step can be reached in a single break, wherein the program execution can be replayed to the predecessor step in a minimal number of breaks;
- replaying the program execution to the predecessor step;
- unsetting any breakpoints that would cause the program execution to break before the target step;
- setting a breakpoint that will cause the program execution to next break at the target step, and
- running the program execution to its next break, wherein the program execution stops at the target step.
A computer system for replaying an execution of a computer program to a target step, the system comprising:
- a central processing unit having a function to set a breakpoint;
- a first memory accessible to the central processing unit, the memory comprising an executable program to replay an execution of a computer program;
- a second memory comprising a trace of a computer program execution;
- wherein the first memory comprises instructions which, when executed, operate on second memory content, the instructions performing the functions of:
- receiving the selection of the target step, wherein the target step is not an initial step in the program;
- calculating an optimal predecessor step of the target step, the predecessor step preceding the target step and from which the target step can be reached in a single break, wherein the program execution can be replayed to the predecessor in a minimal number of breaks;
- replaying the program execution to the predecessor step;
- unsetting any breakpoints that would cause the program execution to break before the target step;
- setting a breakpoint that will cause the program execution to next break at the target step, and
- running the program execution to its next break, wherein the program execution stops at the target step.
A computer-readable medium having computer-executable instructions for performing a method of replaying a computer program, the method comprising:
- calculating an optimal predecessor step of the target step by setting a candidate optimal predecessor step to the step immediately preceding the target step and repeatedly testing:
- (a) whether the candidate step is not an initial state, and
- (b) whether the target step is reachable in a single break from the optimal predecessor of the candidate step,
- and, if (a) and (b) are true, setting the candidate step to the optimal predecessor of the candidate step, and if (a) or (b) are false, setting the optimal predecessor of the target step to be the candidate step, the predecessor step preceding the target step and from which the target step can be reached in a single break, wherein the program execution can be replayed to the predecessor in a minimal number of breaks;
- replaying the program execution to the predecessor step;
- unsetting any breakpoints that would cause the program execution to break before the target step;
- setting a breakpoint that will cause the program execution to next break at the target step, and
- running the program execution to its next break, wherein the program execution stops at the target step.
Dependencies are inferred from the claim text.