Method and apparatus for providing runtime checking features in a compiled programming development environment
First Claim
1. A method for performing runtime checking operations in a compiled programming development environment, comprising the steps of:
- a) compiling a source code file into executable object code comprising machine language instructions, wherein said source code file includes aggregate data items and pointers and also includes expressions which manipulate said aggregate data items and pointers, wherein said step of compiling comprises;
creating data structures for aggregate data items and pointers in the source code file; and
inserting calls to runtime checking functions for one or more expressions in the source code file which manipulate said aggregate data items and pointers; and
b) executing the executable object code, wherein said step of executing comprises;
executing one or more of said runtime checking functions to determine if invalid operations occur in said expressions which manipulate said aggregate data items and pointers; and
reporting an error to the user if an invalid operation is found to occur after said step of executing one or more of said runtime checking functions.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus for performing runtime checking during program execution in a compiled environment using the full ANSI-C programming language. The present invention detects a number of errors during runtime that cannot be found by a compiler at the precise moment that a respective C language restriction is violated. The present invention also provides the user with a direct indication of the problem, thus saving debugging time. The runtime checking features of the present invention further detects when a user is using library functions improperly. When C source code is compiled, the present invention allocates special data structures for every pointer, array and structure object in the program. An association is made between each of these objects, and its special data structure in the compiler symbol table. At runtime, these data structures contain status information about their associated objects. The present invention also inserts special machine language instructions for C expressions during compilation that either modify values in the special data structures or call internal runtime checking functions according to the present invention that use the information in the respective data structures to determine whether an expression is illegal and report errors if necessary. The runtime checking features of the present invention include a method for specifying precise restrictions on the arguments that may be passed to library functions. These restrictions are used to determine whether arguments to library functions conform to their respective restrictions and reports any violations to the user at runtime, indicating which argument caused the error and which restriction was violated.
-
Citations
45 Claims
-
1. A method for performing runtime checking operations in a compiled programming development environment, comprising the steps of:
-
a) compiling a source code file into executable object code comprising machine language instructions, wherein said source code file includes aggregate data items and pointers and also includes expressions which manipulate said aggregate data items and pointers, wherein said step of compiling comprises; creating data structures for aggregate data items and pointers in the source code file; and inserting calls to runtime checking functions for one or more expressions in the source code file which manipulate said aggregate data items and pointers; and b) executing the executable object code, wherein said step of executing comprises; executing one or more of said runtime checking functions to determine if invalid operations occur in said expressions which manipulate said aggregate data items and pointers; and reporting an error to the user if an invalid operation is found to occur after said step of executing one or more of said runtime checking functions. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)
-
-
36. A method for performing runtime checking on arguments passed to external libraries in a compiled programming environment, comprising the steps of:
-
inserting argument restrictions into a source code file; generating argument runtime checking code based on said inserted argument restrictions; linking said argument runtime checking code to a library; executing a program which includes one or more calls to functions in said library, wherein said one or more calls to said functions in said library pass one or more arguments to said functions in said library; executing said argument runtime checking code to determine if said one or more arguments passed to said functions in said library violate said argument restrictions; reporting an error if said one or more arguments passed to said functions in said library violate said argument restrictions. - View Dependent Claims (37, 38, 39, 40)
-
-
41. A method for performing runtime checking operations in a compiled programming environment, comprising the steps of:
-
a) compiling a first number of source code files into unlinked object code files comprising machine language instructions, wherein said first number of source code files includes aggregate data items and pointers and also includes expressions which manipulate said aggregate data items and pointers, wherein said step of compiling comprises; creating runtime checking data structures for aggregate data items and pointers in said first number of source code files; and inserting calls to runtime checking functions for one or more expressions in said first number of source code files which manipulate said aggregate data items and pointers; b) compiling a second number of source code files into unlinked external object code files, wherein said step of compiling said second number of source code files into unlinked external object code files does not include said steps of creating runtime checking data structures or inserting calls to runtime checking functions; c) linking said unlinked object code files and said unlinked external object code files into a plurality of linked object code executable files; and d) executing said plurality of linked object code executable files, wherein said step of executing comprises; executing one or more of said runtime checking functions to determine if invalid operations occur in said expressions which manipulate said aggregate data items and pointers; and reporting an error to the user if an invalid operation is found to occur alter said step of executing one or more of said runtime checking functions. - View Dependent Claims (42, 43)
-
-
44. A method for performing runtime checking operations in a compiled programming development environment, comprising the steps of:
-
a) compiling a source code file into executable object code comprising machine language instructions, wherein said source code file includes pointers and also includes expressions which manipulate said pointers, wherein said step of compiling comprises; creating data structures for pointers in the source code file; and inserting calls to runtime checking functions for one or more expressions in the source code file which manipulate said pointers; and b) executing the executable object code, wherein said step of executing comprises; executing one or more of said runtime checking functions to determine if invalid operations occur in said expressions which manipulate said pointers; and reporting an error to the user if an invalid operation is found to occur after said step of executing one or more of said runtime checking functions.
-
-
45. An apparatus for performing runtime checking operations in a compiled programming development environment, comprising:
-
a compiler which compiles a source code file into executable object code comprising machine language instructions, wherein said source code file includes aggregate data items and pointers and also includes expressions which manipulate said aggregate data items and pointers, wherein said compiler creates data structures for aggregate data items and pointers in the source code file and inserts calls to runtime checking functions for one or more expressions in the source code file which manipulate said aggregate data items and pointers; and means for executing the executable object code, wherein said means executes one or more of said runtime checking functions to determine if invalid operations occur in said expressions which manipulate said aggregate data items and pointers and reports an error to the user if an invalid operation is found to occur after executing one or more of said runtime checking functions, wherein said means for executing accesses one or more of said data structures in executing said runtime checking functions.
-
Specification