A Practical, Robust Method for Generating Variable Range Tables
In optimized programs the location in which the current value of a single source variable may reside typically varies as the computation progresses. A debugger for optimized code needs to know all of the locations — both registers and memory addresses — in which a variable resides, and which locations are valid for which portions of the computation. Determining this information is known as the data location problem. Because optimizations frequently move variables around (between registers and memory or from one register to another) the compiler must build a table to keep track of this information. Such a table is known as a variable range table. Once a variable range table has been constructed, finding a variable’s current location reduces to the simple task of looking up the appropriate entry in the table.
The difficulty lies in collecting the data for building the table. Previous methods for collecting this data depend on which optimizations the compiler performs and how those optimizations are implemented. In these methods the code for collecting the variable location data is distributed throughout the optimizer code, and is therefore easy to break and hard to fix. This paper presents a different approach. By taking advantage of key instructions, our approach allows the collection of all of the variable location data in a single dataflow-analysis pass over the program. This approach results in code for collecting the variable location information that is easier to maintain than previous approaches and that is almost entirely independent of which optimizations the compiler performs and of how the optimizations are implemented.
- A. Adl-Tabatabai and T. Gross, “Evicted Variables and the Interaction of Global Register Allocation and Symbolic Debugging”, Conference Record of the Twentieth Annual ACM Symposium on Principles of Programming Languages, January 1993, pp. 371–383
- A. Aho, R. Sethi, and J. Ullman, “Compilers Principles, Techniques, and Tools”, Addison-Wesley Publishing Company, 1986
- D. Coutant, S. Meloy, and M. Ruscetta, “DOC: A Practical Approach to Source-Level Debugging of Globally Optimized Code”, In Proceedings of the 1988 PLDI Conference, 1988
- J. Silverstein, ed., “DWARF Debugging Information Format”, Proposed Standard, UNIX International Programming Languages Special Interest Group, July 1993
- C. Tice and S. L. Graham, “Key Instructions: Solving the Code Location Problem for Optimized Code”, Research Report 164, Compaq Systems Research Center, Palo Alto, CA, Sept. 2000
- C. Tice, “Non-Transparent Debugging of Optimized Code”, Ph.D. Dissertation, Technical Report UCB//CSD-99-1077, University of California, Berkeley, Oct. 1999.
- P. Zellweger, “High Level Debugging of Optimized Code”, Ph.D. Dissertation, University of California, Berkeley, Xerox PARC TR CSL-84-5, May 1984.
- A Practical, Robust Method for Generating Variable Range Tables
- Book Title
- Compiler Construction
- Book Subtitle
- 10th International Conference, CC 2001 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2001 Genova, Italy, April 2–6, 2001 Proceedings
- pp 102-117
- Print ISBN
- Online ISBN
- Series Title
- Lecture Notes in Computer Science
- Series Volume
- Series ISSN
- Springer Berlin Heidelberg
- Copyright Holder
- Springer-Verlag Berlin Heidelberg
- Additional Links
- Industry Sectors
- eBook Packages
To view the rest of this content please follow the download PDF link above.