Detecting Unexpected Data Values In Optimized Code

Download Detecting Unexpected Data Values In Optimized Code PDF/ePub or read online books in Mobi eBooks. Click Download or Read Online button to get Detecting Unexpected Data Values In Optimized Code book now. This website allows unlimited access to, at the time of writing, more than 1.5 million titles, including hundreds of thousands of titles in various foreign languages.
Detecting Unexpected Data Values in Optimized Code

Abstract: "Optimizing compilers produce code that impedes source- level debugging. After optimization, the correspondence between a program's source code and object code is not straightforward. An important problem for a source-level debugger of optimized programs is to be able to determine when, because of optimizations, the value of a variable does not correspond to what the user expects. This paper describes a solution to this problem. The solution uses reaching sets to determine when the definitions of a variable that reach a breakpoint location in an optimized program are not the definitions that would have reached in the unoptimized program."
Debugging Optimized Code Without Being Misled

Abstract: "Optimizing compilers produce code that impedes source- level debugging. Examples are given in which optimization changes the behavior of a program even when the optimizer is correct, showing that in some circumstances it is not possible to completely debug an unoptimized version of a program. Source-level debuggers designed for unoptimized code may mislead the debugger user when invoked on optimized code. One situation that can mislead the user is a mismatch between where the user expects a breakpoint to be located and the breakpoint's actual location. This mismatch may occur due to statement reordering and discontiguous code generated from a statement. 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 closely enough that the user need not make severe changes in debugging strategies. Another situation that can mislead the user is when optimization has caused 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 gives and proves 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. The information a compiler must make available to the debugger for this task is also described."