DEBUGGING OPTIMIZED CODE WITHOUT BEING MISLED: CURRENCY DETERMINATION
Max Copperman · 1993
This paper 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 paper 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. Categories and Subject Descriptors: D.2.5 [Software Engineering]: Testing and Debugging --- debugging aids; D.2.6 [Software Engineering]: Programming Environments; D.3.4 [Programming Languages]: Processors --- code generation, compilers, optimization