Debugging optimized code without being misled
- 1 May 1994
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 16 (3) , 387-427
- https://doi.org/10.1145/177492.177517
Abstract
Correct optimization can change the behavior of an incorrect program; therefore at times it is necessary to debug optimized code. However, optimizing compilers produce code that impedes source-level debugging. Optimization can cause an inconsistency between where the user expects a breakpoint to be located and the breakpoint's actual location. This article describes a mapping between statements and breakpoint locations that ameliorates this problem. The mapping enables debugger behavior on optimized code that approximates debugger behavior on unoptimized code sufficiently closely for the user to use traditional debugging strategies. Optimization can also cause the value of a variable to be noncurrent —to differ from the value that would be predicted by a close reading of the source code. This article presents a method of determining when this has occurred, and shows how a debugger can describe the relevant effects of optimization. The determination method is more general than previously published methods; it handles global optimization and many flow graph transformations, and it is not tightly coupled to optimizations performed by a particular compiler. Necessary compiler support is also described.Keywords
This publication has 12 references indexed in Scilit:
- Detection and recovery of endangered variables caused by instruction schedulingPublished by Association for Computing Machinery (ACM) ,1993
- Adapting a debugger for optimised programsACM SIGPLAN Notices, 1993
- A further note on Hennessy's “Symbolic debugging of optimized code”ACM Transactions on Programming Languages and Systems, 1993
- A new approach to debugging optimized codeACM SIGPLAN Notices, 1992
- Incremental global reoptimization of programsACM Transactions on Programming Languages and Systems, 1992
- Source level debugging of automatically parallelized codeACM SIGPLAN Notices, 1991
- Debugging parallelized code using code liberation techniquesACM SIGPLAN Notices, 1991
- Techniques for debugging parallel programs with flowback analysisACM Transactions on Programming Languages and Systems, 1991
- PELAS-program error-locating assistant systemIEEE Transactions on Software Engineering, 1988
- Symbolic Debugging of Optimized CodeACM Transactions on Programming Languages and Systems, 1982