Computer method and apparatus for safe instrumentation of...

Data processing: software development – installation – and managem – Software program development tool – Testing or debugging

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S129000, C717S131000, C717S152000, C717S153000, C717S154000, C717S155000, C717S156000, C717S157000, C717S158000, C717S159000, C712S243000, C712S244000, C714S034000, C714S035000, C714S038110, C714S039000

Reexamination Certificate

active

06470493

ABSTRACT:

BACKGROUND OF THE INVENTION
A computer application (i.e., program) is formed of a series of instructions referred to as “lines of code”. Initially, these instructions are written in a human readable programming language, e.g., Fortran, C++, etc. This is referred to as the program source code. A compiler transforms the source code into machine readable code. It is the machine readable code, or a binary image of the same, that is the executable form (by a digital processor) of the application program.
To assist in debugging or analyzing a program, certain additional machine readable lines of code called instrumentation points are desired to be inserted into the executable image. At these specified points, new procedure invocations are introduced into the program. Instrumented programs are executed in the same manner as the original program, with the new procedures being invoked at the instrumented points in the program. These new procedures, or analysis routines, provide, for example, the values of parameters at the instrumentation point in the program, the number of times a procedure in the program is called, and other information about certain parts of the program. To that end, the new procedures/analysis routines of the instrumented program provide the capability for debugging and other types of analysis of the program. When executed, the instrumented application produces the desired type of analysis action as it runs.
Instrumentation points are allowed at procedure boundaries, basic block boundaries and/or instruction boundaries. Introducing binary instrumentation into the prologue code (initialization portion) of a procedure is a difficult problem. The primary issue is that if prologue code is used as an exception-handling mechanism for unwinding the stack frame, the introduction of other instructions into the prologue may compromise or break exception handling.
In the Atom and NT-Atom (both by Digital Equipment Corporation of Maynard, Mass.) instrumentation frameworks, the ability to properly instrument the prologue is a fundamental requirement for doing simulated performance studies. The current method that Atom utilizes on Tru64 Unix is to insert instrumentation code directly in the prologue potentially breaking exception handling of instrumented Tru64 applications. The current released version of NT-Atom does not instrument the prologue of any routine, thus guaranteeing that exception handling will operate properly.
SUMMARY OF THE INVENTION
Thus there is need for a technique which allows binary instrumentation of prologue code in program procedures while preserving the exception-handling's mechanism for unwinding the procedures stack frame. Such is the object of the present invention.
The present invention provides a method and apparatus to safely insert instrumentation code into the prologue of a procedure. The invention works with programming models that respond to exceptions or unwinding mechanisms by reverse executing the prologue code. Reverse execution of the prologue returns the state of the program to a condition that it was prior to the execution of the procedure.
The invention method introduces binary instrumentation into a procedure's prologue by duplicating components of the prologue and then instrumenting the original version of the prologue. The non-standard prologue instructions are preserved in the original sequence of instrumented prologue instructions. The net effect is that exception handling is preserved and the full prologue with non-standard instructions can be instrumented and executed without altering the program's intended behavior.
In the preferred embodiment, the method includes the steps of: (a) identifying a portion of the subject program into which insertion of instrumentation code is desired; (b) duplicating the identified portion such that a working copy of the identified portion is formed, said duplicating including placing the working copy before the identified portion; (c) removing instructions from the working copy such that only instructions necessary to restore calling context remains; (d) instrumenting the identified portion; and (e) enabling the working copy for use during reverse execution of the subject program and otherwise effecting use of the instrumented identified portion in the subject program.
Further, rewind instructions are inserted between the working copy and the original identified portions to reverse the effect of duplicated instructions in the identified portion. Preferably, working constructs (i.e., pointers) are set such that the working copy serves as an entry point and the original identified portion is effectively part of the main body of a program module.
Apparatus of the present invention includes an instrumentation assembly coupled to an instrumentation coder. The instrumentation assembly effects steps (a), (b), (c) and (e) of the foregoing method. The instrumentation coder effects step (d). Preferably, the instrumentation coder follows techniques of U.S. Pat. Nos. 5,539,907 and 5,732,273.


REFERENCES:
patent: 5539907 (1996-07-01), Srivastava et al.
patent: 5732273 (1998-03-01), Srivastava et al.
patent: 5926832 (1999-07-01), Wing et al.
patent: 5966537 (1999-10-01), Ravichandran
patent: 6081665 (2000-06-01), Nilsen et al.
patent: 6293712 (2001-09-01), Coutant
patent: 6327699 (2001-12-01), Larus et al.
patent: 6327704 (2001-12-01), Mattson et al.
patent: 6339832 (2002-01-01), Bowman-Amuah
patent: 2000020320 (2000-01-01), None
Steven et al., “Using a Resource-Limited Instruction Scheduler to Evaluate The iHARP Processor”, IEEE, pp.: 23-31, Jan. 1995.*
Sinha et al., “Analysis of Programs With Exception-Handling Constructs”, IEEE, pp.: 1-10, Nov. 1998.*
Le, “An Out-of-Order Execution Technique for Runtime Binary Translators”, ACM, pp.: 151-158, Oct. 1998.*
Johnson, “Some Requirement for Architectural Support of Software Debugging”, ACM, pp.: 140-148, 1982.*
Goodenough, “Exception Handling: Issues a Proposed Notation”, ACM, pp.: 683-696, Dec. 1975.*
Vo et al., “Xept: A Software Instrumental Method for Excepting Handling”, IEEE pp.: 60-69, 1997.*
IBM Technical Disclosure Bulletin, “Handling Error Exception from Source Program”, vol. 35, No. 1A, pp.: 23-24, Jun. 1992.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Computer method and apparatus for safe instrumentation of... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Computer method and apparatus for safe instrumentation of..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Computer method and apparatus for safe instrumentation of... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2981733

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.