Method of instrumenting code having restrictive calling conventions
AssigneeMicrosoft Corporation
InventorIshai Aroya
Life of this patent
Estimating the term…
Abstract
A development environment for computer programs in which programs under test may be instrumented with probe functions. The probe functions are called through a wrapper function structured to comply with restrictive calling conventions of the platform for which the computer program is developed. By complying with the calling convention, proper operation of the computer program is achieved during testing even if an exception handler, or other program element that relies on compliance with the calling convention, is invoked. Once instrumented, the computer program may be tested to determine whether it executes desired logic function to determine the performance of the program or for other test functions.
Claims20
A method of instrumenting a software program, having a plurality of locations and an operating state when executed, with at least one probe function adapted to record information on the operating state at a location within the software program, the method comprising modifying the software program to cause a wrapper function to execute, the wrapper function comprising at least one computer-executable instruction that causes the probe function to execute.
A method of testing a software program having a plurality of locations on a platform having registers having values and a calling convention in which the values in at least one of the registers is preserved upon a function call, the method being of the type that includes executing at least one probe function at an instrumented location in the program and further comprising executing the software program by:
- a) at the instrumented location, executing an instruction that causes a wrapper function to execute;
- and
- b) from within the wrapper function:
- i) preserving the state of the platform,
- ii) calling the probe function;
- and
- iii) restoring the state of the platform.
A computer-readable medium having computer-executable instructions for implementing a development environment for a software program, the computer-executable instructions performing steps comprising:
- a) modifying a binary file containing an executable version of the software program to include a probe function and a wrapper function that calls the probe function;
- b) identifying an identified location in the binary file where a probe function is to be executed;
- and
- c) providing at the identified location an instruction that causes the wrapper function to execute.
Dependencies are inferred from the claim text.