System for measuring program execution by replacing an executable instruction with interrupt causing instruction
First Claim
1. In a computer system having a memory for storing a computer program and a processor for executing the stored computer program, said computer system having at least one an interrupt-causing instruction and the computer program comprising a first set of executable instructions stored in said memory, a method for determining which ones of a subset of said first set of executable instructions are not executed when the program is executed, comprising the steps of:
- making a program copy from said stored computer program, said program copy comprising a second set of executable instructions identical to said first set of executable instructions;
storing said program copy in said memory;
modifying the stored program copy by replacing each one of a subset of said second set of executable instructions in said program copy with an interrupt-causing instruction;
initiating the execution of the modified program copy;
in response to the execution of each one of the interrupt-causing instructions in the program copy, performing the steps of;
locating in said first set of executable instructions an instruction identical to the instruction replaced by the executed one of the interrupt-causing instructions;
restoring the replaced instruction by writing said located instruction in place of the executed interrupt-causing instruction in said program copy; and
executing the restored instruction.
4 Assignments
0 Petitions
Accused Products
Abstract
A computer program measures the execution of machine code instructions in an executing program. A copy of the measured program is made and selected machine instructions are replaced by interrupt-causing breakpoint instructions. As each breakpoint instruction is executed, the breakpoint is replaced by the actual instruction, and a bit map is updated to indicate execution of the measured instruction. Execution resumes with the actual instruction.
177 Citations
17 Claims
-
1. In a computer system having a memory for storing a computer program and a processor for executing the stored computer program, said computer system having at least one an interrupt-causing instruction and the computer program comprising a first set of executable instructions stored in said memory, a method for determining which ones of a subset of said first set of executable instructions are not executed when the program is executed, comprising the steps of:
-
making a program copy from said stored computer program, said program copy comprising a second set of executable instructions identical to said first set of executable instructions; storing said program copy in said memory; modifying the stored program copy by replacing each one of a subset of said second set of executable instructions in said program copy with an interrupt-causing instruction; initiating the execution of the modified program copy; in response to the execution of each one of the interrupt-causing instructions in the program copy, performing the steps of; locating in said first set of executable instructions an instruction identical to the instruction replaced by the executed one of the interrupt-causing instructions; restoring the replaced instruction by writing said located instruction in place of the executed interrupt-causing instruction in said program copy; and executing the restored instruction. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. In a computer system having a memory for storing a computer program and a processor for executing the stored computer program, said computer system having at least one an interrupt-causing instruction and the computer program comprising a set of executable instructions, a method for determining which ones of a selected subset of the set of executable instructions are executed, comprising the steps of:
-
storing a first copy of the computer program in the memory; storing a second copy of the computer program in the memory; selecting a subset of the set of instructions from the second copy of the computer program; modifying the second copy of the program by replacing each of the instructions in the selected subset with an interrupt-causing instruction; executing the modified second copy of the program; in response to the execution of each one of the interrupt-causing instructions, performing the steps of; identifying the instruction replaced by the executed interrupt-causing instruction; indicating that the identified instruction will be executed; restoring the replaced instruction by copying the identified instruction from said first copy of the program over the interrupt-causing instruction; and executing the restored instruction. - View Dependent Claims (10, 11, 12, 13)
-
-
14. In a computer system having a memory for storing a computer program and a processor for executing the stored computer program, said computer system having at least one an interrupt-causing instruction and the computer program comprising a first set of instructions, a method for determining which ones of a selected subset of said first set of instructions are executed, comprising the steps of:
-
making and storing a second copy of the computer program, said second copy comprising a second set of instructions identical to said first set of instructions; selecting a subset of the second set of instructions; modifying the second copy of the computer program by replacing each of the selected instructions in the second copy of the computer program with an interrupt-causing instruction; initializing a map, said map comprising a set of storage locations, each of said storage locations corresponding to one of the interrupt-causing instructions; initiating the execution of the modified second copy of said computer program; in response to each interrupt during execution of the modified second copy of the computer program, performing the steps of; ascertaining the location in the program of the interrupt-causing instruction; storing a predetermined value in the map storage location corresponding to the interrupt-causing instruction to indicate that the instruction replaced by the interrupt-causing instruction will be executed; restoring the replaced instruction by copying the instruction from the ascertained location in the first copy of the program to the ascertained location in the second copy of the program; and executing the restored instruction.
-
-
15. A computer system having at least one an interrupt-causing instruction for executing a stored program and analyzing program coverage comprising:
-
memory means for storing programs and data; a first copy of the program stored in said memory means, the first copy comprising a first set of executable instructions; a second copy of the program stored in said memory means, the second copy comprising a second set of executable instructions identical to said first set of executable instructions; processing means coupled to said memory means for replacing each one of a subset of the second set of executable instructions with an interrupt-causing instruction and then executing the second copy of the program and, in response to the execution of an interrupt-causing instruction, restoring the instruction replaced by said interrupt-causing instruction by copying the replaced instruction from the first program to the location of the executed interrupt-causing instruction and executing the restored instruction; and reporting means for reporting which ones of the subset of instructions have been restored and executed. - View Dependent Claims (16, 17)
-
Specification