Method and apparatus for dynamically instrumenting a program
AssigneeSamsung Electronics Co., Ltd.
InventorJae-hoon JEONG
Life of this patent
Estimating the term…
Abstract
A dynamic instrumentation method and apparatus which may trace, debug, and profile the execution of a running program without affecting the operation of the program, are provided. According to the method, a break instruction is inserted and executed at start of execution of a first instruction and immediately after execution of the last instruction of a function constituting the program. Environment values of the function before and after execution may be identified. The program may be dynamically instrumented without being affected by any tracing or debugging operations.
Claims17
A method of dynamically instrumenting a program using a dynamic instrumentation apparatus, the method comprising:
- storing one or more environment values of a function before execution by inserting a break instruction at a location of a first instruction of the function included in the program and executing the break instruction at the start of execution of the first instruction;
- and
- storing one or more environment values of the function after execution by executing a break instruction when execution proceeds to a return address after the last instruction of the function is executed.
An apparatus for dynamically instrumenting a program, the apparatus comprising:
- an instruction managing unit configured to store instructions of a function of a program and to insert a break instruction at a location of each instruction;
- and
- a probe unit configured to store one or more environment values of the function according to execution of each break instruction.
A method of an apparatus for dynamically tracing a software program, the method comprising:
- determining that a first instruction of a function of a software program to be executed is not stored in memory;
- substituting a break instruction in place of the first instruction;
- loading to memory a corresponding page comprising the first instruction;
- executing the break instruction to generate an exception;
- and
- in response to the exception being executed, measuring and storing one or more environment values of the software program.
Dependencies are inferred from the claim text.