ACM Transactions on Programming Languages and Systems · 1994 · 51 citations · 19 references
EngineeringCompiler TechnologyVerificationSoftware SystemsSoftware EngineeringSource Code AnalysisSoftware AnalysisCompilersProgramming LanguagesSource CodeStatic AnalysisComputer EngineeringComputer ScienceProgram OptimizationDebuggerOptimizing CompilerStatic Program AnalysisCorrect OptimizationIncorrect ProgramProgram AnalysisSoftware TestingFormal MethodsSoftware Debugging
Optimizing compilers can alter program behavior, misplace breakpoints, and produce stale variable values, making source‑level debugging difficult. The article aims to provide a mapping between source statements and breakpoint locations and a method to detect and describe optimization effects on debugging. The authors implement a mapping from source statements to breakpoint locations and a general detection method that approximates unoptimized debugging, handles global optimizations and flow‑graph transformations, and requires only modest compiler support.
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.
19
Symbolic Debugging of Optimized Code
John L. Hennessy · ACM Transactions on Programming Languages and Systems · 1982 · 165 citations · Full text
Rosana Balzer · 1969 · 149 citations
Engineering, Computer Architecture, Assembly-language Level +18