Method and apparatus for debugging of optimized machine...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000

Reexamination Certificate

active

06256777

ABSTRACT:

FIELD OF THE INVENTION
This invention relates to a method and apparatus for debugging of optimized machine code and, more particularly, to a method and apparatus which enables a debugging operation to proceed on optimized machine code, while allowing access to all variables used in the optimized machine code and causing the optimized machine code to execute in source code order.
BACKGROUND OF THE INVENTION
A compiler is a program that reads a program written in a first language, i.e., the source language, and translates the first language to an equivalent program in a second language, i.e., a target or machine code language. During the process of compiling a source language into a machine language, the compiler generates an intermediate representation which is then subjected to an optimization action, prior to being output as the machine code. The code optimization phase attempts to improve the intermediate language so that faster executing machine code will result.
During an optimizing action, the compiler may reorder or eliminate the execution of source level expressions. Such reordering or elimination destroys the sequential correspondence between the source statements and the machine code statements, while potentially rendering the machine code into a more efficiently executing program.
Debugging allows a user to control the execution of a program (e.g., by the setting of breakpoints) and to inspect the state of execution of the program at each breakpoint (e.g., to print a current value of a variable). A symbolic debugger is a program wherein all interactions are in terms of the source level language program from which the machine code has been derived. An optimizing compiler makes more difficult the task of the symbolic debugger by complicating the correspondence between the source code and the machine code. Any reordering or elimination of source level expressions complicates the mapping of breakpoints and values in the source code to those in the machine code.
In addition to statement reordering or elimination, an optimizer performs “lifetime shortening” actions with respect to variables used in the program. More particularly, machine code generated by the optimizer will discard the value of a variable as soon as the compiler can see no further need for it—even though it would be useful for a debugger if the compiler would continue to make the variable value available.
In regards to statement reordering/elimination, the debugging of such optimized code is rendered difficult due to the fact that the user is conversant with the sequence of actions of the source code and expects the machine code to operate, with the same sequence of operations.
When debuggers attempt to debug optimized code, they approach the statement re-ordering problem in a relatively simplistic manner. Debuggers generally run the program in the revised order in which the compiler has placed the machine instructions and display to the user that order. The debugger may, in addition provide some information to the user which indicates the fact of a re-ordering at the place in the code where the re-ordering occurred. Such a debugging operation is described in “DOC: a Practical Approach to Source-Level Debugging of Globally Optimized Code,” Coutant et al., Proceedings of SIGPLAN 1988, Conference on Programming Language Design and Implementation, Atlanta, Ga., 1988, pgs. 125-134. The prior art has also suggested the use of graphical display techniques to assist a user in tracking the altered execution order of the machine code from the source code.
Notwithstanding such debugging aids, statement reordering/elimination still presents significant difficulties to the user during a debugging operation.
Prior art solutions to variable lifetime shortening have included the following: (i) making a register allocator function lengthen register lifetimes to as long a period as possible; and (ii) causing a debugger to recognize when a variable's lifetime has ended or may have ended and to print a warning of the lifetime end of the variable. The first of these solutions compromises the compiler's ability to optimize the machine code and, at best, only reduces the frequency with which data is lost. It does not prevent the loss of the data. The second solution simply tells the user when the problem arises, but doesn't stop it from arising.
Such solutions are discussed in the following prior art references: “Evicted Variables and the Interaction of Global Register Allocation and Symbolic Debugging”, Adl-Tabatabai et al., ACM-20th PoPL, January 1993, pgs. 371-383; “Detection and Recovery of Endangered Variables Caused by Instruction Scheduling”, Adl-Tabatabai et al., ACM-SIGPLAN-PLDI, June 1993, pgs. 13-25; and “Debugging Optimized Code Without Being misled”, M. Copperman, Report 92-01, May 8, 1992, Board of Studies in Computer and Information Sciences, University of California at Santa Cruz, Calif. 95064.
There is a need for a more efficient method for debugging optimized machine code which avoids the problems created by the discard of variable values and statement reordering or elimination.
SUMMARY OF THE INVENTION
A debugging method is described wherein a debug information file is constructed which includes information that identifies changes of variable value assignments to registers at plural steps of program. The information further includes data that identifies any change of sequence of machine code instructions from the sequence of source code statements that gave rise to the machine code instructions. Using such information, hidden breakpoints are inserted into the machine code (wherein a hidden breakpoint enables access to an instruction to either store a variable value from an identified register or to move to a machine code instruction that corresponds in order to a source code statement that gave rise to the machine code instruction). Thereafter, the program is executed under control of a debug program and, upon encountering a hidden breakpoint, automatically either stores the variable value that exists in the identified register or moves to execute a machine code instruction that is indicated by the hidden breakpoint. The actions carried out in response to a hidden breakpoint are invisible to the user.


REFERENCES:
patent: 4953084 (1990-08-01), Meloy et al.
patent: 5265254 (1993-11-01), Blasciak et al.
patent: 5533192 (1996-07-01), Hawley et al.
patent: 5812850 (1998-09-01), Wimble
patent: 5881288 (1999-03-01), Sumi et al.
patent: 5889981 (1999-03-01), Betker et al.
patent: 5956479 (1999-09-01), McInerney et al.
patent: 5956512 (1999-09-01), Simmons et al.
patent: 6091896 (2000-07-01), Curreri et al.
Rosenberg, J.B.; How Debuggers Work: Algorithms, Data Structures, and Architecture. New York, NY, John Wiley, Chapter 6, pp. 107-133, Dec.-1996.*
Copperman et al.; “Technical Correspondence: A Further Note on Hennessy's ‘Symbolic Debugging of Optimized Code’”. ACM Transactions on Programming Languages and Systems, vol. 15, Iss 2, pp. 357-365, Apr. 1993.*
Brooks et al.; “A New Approach to Debugging Optimized Code”. Proceedings of the 5th ACM SIGPLAN, pp 1-11, Jun. 1992.*
Iyengar et al.; “An event-based, retargetable debugger”. Hewlett-Packard Journal, v45, n6, p33(11), Dec. 1994.*
Ackerman, M.; “Multilevel debugger”. PC Tech Journal, v5, n3, p90(7), Mar. 1987.*
Hewlett Packard Company; “HP/DDE Debugger User's Guide”. Accessed on Aug. 07, 2000. Retrieved from the Internet: http://docs.hp.com:80/dynaweb/hpux10/dtdeen0a/b53/@Generic-BookTextView;hf=0, Jul. 1996.*
Carnegie Mellon University, School of Computer Science, 1993, pp. 371-383, Adl-Tabatabai et al., “Evicted Variables and the Interaction of Global Register Allocation and Symbolic Debugging”.
Carnegie Mellon University, School of Computer Science, 1993, pp. 13-25, Adl-Tabatabai et al., “Detection and Recovery of Endangered Variables Caused by Instruction Scheduling”.
Proceedings of SIGPLAN 1988, Conference of Programming Language Design & Implementation, pp. 125-134, D. S. Coutant et al., “DOC: A Practical Approach to S

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

Method and apparatus for debugging of optimized machine... does not yet have a rating. At this time, there are no reviews or comments for this patent.

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

Rate now

     

Profile ID: LFUS-PAI-O-2545489

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