Debugging program code at instruction level through emulation
First Claim
1. A method, implemented at a computer system that includes one or more processors, for debugging executable code, the method comprising:
- executing the executable code within a target computing environment;
stopping execution of the executable code within the target computing environment at a current function;
locating an instruction code segment of the current function wherein the instruction code segment is an epilog of the current function;
copying a snapshot of the target computing environment to an emulation computing environment, the snapshot including a set of data related to executing the executable code within the target computing environment;
emulating the instruction code segment within the emulation computing environment while maintaining state of the executable code within the target computing environment;
after emulating the instruction code segment within the emulation computing environment, retrieving at least one value of a non-volatile register for a caller function of the current function, wherein the instruction code segment modifies the at least one value of the non-volatile register; and
based on the retrieved at least one value of the non-volatile register for the caller function, emulating one or more executable code instructions of the caller function within the emulation computing environment.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods and systems are disclosed for debugging program code at instruction level by emulating an epilog. Issues with retrieving values that a caller function has stored in non-volatile registers before calling a callee function are addressed at the instruction code level by through emulation. The epilog of the callee function may be emulated after copying a computing environment of the target program code from a target system to an emulation system. When the debugged code does not include an epilog, values that a caller function stored before calling a callee function in non-volatile registers may be retrieved by emulating the calling function forward from the breakpoint.
24 Citations
20 Claims
-
1. A method, implemented at a computer system that includes one or more processors, for debugging executable code, the method comprising:
-
executing the executable code within a target computing environment; stopping execution of the executable code within the target computing environment at a current function; locating an instruction code segment of the current function wherein the instruction code segment is an epilog of the current function; copying a snapshot of the target computing environment to an emulation computing environment, the snapshot including a set of data related to executing the executable code within the target computing environment; emulating the instruction code segment within the emulation computing environment while maintaining state of the executable code within the target computing environment; after emulating the instruction code segment within the emulation computing environment, retrieving at least one value of a non-volatile register for a caller function of the current function, wherein the instruction code segment modifies the at least one value of the non-volatile register; and based on the retrieved at least one value of the non-volatile register for the caller function, emulating one or more executable code instructions of the caller function within the emulation computing environment. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computing device, comprising:
-
at least one processing unit; and at least one memory storing computer executable instructions for debugging program code at instruction level, the instructions when executed by the at least one processing unit causing the computing device to; execute the executable code within a target computing environment; stop execution of the executable code within the target computing environment at a current function; locate an instruction code segment of the current function, wherein the instruction code segment is an epilog of the current function; copy a snapshot of the target computing environment to an emulation computing environment, the snapshot including a set of data related to executing the executable code within the target computing environment; emulate the instruction code segment within the emulation computing environment while maintaining state of the executable code within the target computing environment; after emulating the instruction code segment within the emulation computing environment, retrieve at least one value of a non-volatile register for a caller function of the current function, wherein the instruction code segment modifies the at least one value of the non-volatile register; and based on the retrieved at least one value of the non-volatile register for the caller function, emulate one or more executable code instructions of the caller function within the emulation computing environment. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
-
16. A computer storage device storing computer executable instructions for debugging program code at instruction level, the instructions when executed by at least one processing unit, cause the at least one processing unit to:
-
execute the program code within a target computing environment; stop execution of the program code within the target computing environment at a current function; locate an instruction code segment of the current function, wherein the instruction code segment is an epilog of the current function; copy a snapshot of the target computing environment to an emulation computing environment, the snapshot including a set of data related to executing the executable code within the target computing environment; emulate the instruction code segment within the emulation computing environment while maintaining state of the executable code within the target computing environment; after emulating the instruction code segment within the emulation computing environment, retrieve at least one value of a non-volatile register for a caller function of the current function, wherein the instruction code segment modifies the at least one value of the non-volatile register; and based on the retrieved at least one value of the non-volatile register for the caller function, emulate one or more executable code instructions of the caller function within the emulation computing environment. - View Dependent Claims (17, 18, 19, 20)
-
Specification