Method and apparatus for modifying relocatable object code files and monitoring programs
First Claim
1. A computer implemented method for generating machine instructions including memory access monitoring instructions, said method comprising the steps of:
- receiving as input a first set of machine instructions, said first set of machine instructions being specific to a computer processor with each machine instruction of said first set corresponding to an instruction executable by said computer processor, said first set of machine instructions including memory access instructions that access a region of memory; and
generating a second set of machine instructions from said first set of machine instructions and having additional machine instructions that are memory monitoring instructions, said memory monitoring instructions checking memory status information for said region of memory accessed by said memory access instructions, said memory status information including an allocated state and an unallocated state.
2 Assignments
0 Petitions
Accused Products
Abstract
An object code expansion program inserts new instructions and data between preexisting instructions and data of an object code file; offsets are modified to reflect new positions of the preexisting instructions and data. For each item of preexisting object code (instructions or data), the following steps are performed: making a new code block comprising any desired new instructions and the item, and storing it as new object code; tracking the location of the item and the new code block within the new object code; and tracking items that contain inter-item offsets. Then, each inter-item offset is updated using the new location of the item or new code block, as required. Finally, offsets in symbol tables and relocation structures are updated with the new location of the item. This expansion program is used to add instructions to object code files of a second program, to monitor substantially all of the memory accesses of the second program. The added instructions establish and maintain a memory status array with entries for memory locations that are validly accessible by the second program; entries indicate the status of corresponding memory locations. The memory status array is used to check for the errors of writing to unallocated memory and reading from unallocated or uninitialized memory. Also, the data section of the object code files are expanded with extra dummy entries to aid in the detection of array bounds violations and similar data errors. Furthermore, watchpoints can be established for more comprehensive monitoring.
182 Citations
13 Claims
-
1. A computer implemented method for generating machine instructions including memory access monitoring instructions, said method comprising the steps of:
-
receiving as input a first set of machine instructions, said first set of machine instructions being specific to a computer processor with each machine instruction of said first set corresponding to an instruction executable by said computer processor, said first set of machine instructions including memory access instructions that access a region of memory; and generating a second set of machine instructions from said first set of machine instructions and having additional machine instructions that are memory monitoring instructions, said memory monitoring instructions checking memory status information for said region of memory accessed by said memory access instructions, said memory status information including an allocated state and an unallocated state. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer program product for generating machine instructions including memory access monitoring instructions, comprising:
-
computer code that receives as input a first set of machine instructions, said first set of machine instructions being specific to a computer processor with each machine instruction of said first set corresponding to an instruction executable by said computer processor, said first set of machine instructions including memory access instructions that access a region of memory; computer code that generates a second set of machine instructions from said first set of machine instructions and having additional machine instructions that are memory monitoring instructions, said memory monitoring instructions checking memory status information for said region of memory accessed by said memory access instructions, said memory status information including an allocated state and an unallocated state; and a computer readable medium that stores the computer codes. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
Specification