Method and equipment for debugging optimized code

Application Number: 00107018
Application Date: 2000.04.24
Publication Number: 1271896
Publication Date: 2000.11.01
Priority Information: 1999/4/23 US 09/298692
International: G06F11/34
Applicant(s) Name: Sun Microsystems, Inc.
Inventor(s) Name: C. N. Kerlek;Jr. C. A. Vick;M. H. Paretzny
Patent Agency Code: 72001
Patent Agent: wu limeng
Abstract Methods and apparatus for providing a substantially full set of state information to a debugger, without significantly compromising system performance, in order to debug optimized computer program code are disclosed. According to one aspect of the present invention, a method for obtaining information associated with program code includes adding a segment of code, which includes a representation that is effectively not used after it is computed, to the program code. Debugging code is added in proximity to the segment of code, and machine code is generated from the program code. The machine code includes a break point that is associated with the debugging code, and includes an instruction at the breakpoint. Finally, the method includes replacing the instruction at the break point with a branch instruction that is arranged to cause the debugging code to execute.