Interactive Source-Level Debugging of Optimized Code (PostScript version, PDF version)
Le-Chun Wu
Phd thesis, Department of Computer Science, University of Illinois, Urbana, IL, August 1999
With an increasing number of executable binaries generated by
optimizing compilers today to fully utilize advanced architecture
features, it has become a necessity to support debugging optimized
code. One of the most difficult problems in debugging globally
optimized code is to recover the expected variable values at
source breakpoints. To solve this problem, the debugger not only
has to stop the execution at appropriate places to preserve necessary
program state, but also needs to be able to correctly associate
storage locations with source variables.
In this dissertation, a new framework for debugging globally
optimized code is proposed. This framework consists of a novel
breakpoint implementation scheme and a new data location tracking
mechanism. In the proposed breakpoint implementation scheme, the
debugger takes over the control of execution early and executes
instructions under a new forward recovery model. This enables the
debugger to recover the expected behavior of a program even in the
presence of optimization. Also the source breakpoints are reported to the
user in the order specified by the original source program and
the behavior of exceptions meets what the user expects.
The new data location tracking scheme keeps track of variable
definition information during optimization. A data-flow analysis based
on the definition information preserved is performed to collect data
that is then used to generate the run-time data location information.
With this data location information, a debugger incorporating the
proposed breakpoint implementation scheme can determine if the expected
value of a variable is available at a source breakpoint and how to
recover it.
The debugging framework has been prototyped in both the IMPACT
compiler and an experimental debugger. Experiments conducted
on several integer benchmark programs have yielded encouraging
results. The overhead in executable file size and compile time
incurred by this framework is reasonable. Compared with previous
work, the proposed approach is much more effective in the recovery
of the expected variable values.
[ IMPACT Main Page |
Team Members |
Publications |
Software |
FAQ ]