Interactive source-level debugging for optimized programs (compilation, high-level)

Polle T. Zellweger · 1984

The transformations performed by an optimizing compiler have traditionally impeded interactive debugging in source language terms: after optimization, a program's source text and object code do not have a straightforward correspondence. This dissertation shows that effective interactive source-level debuggers can be provided for optimized programs. Such debuggers can reduce debugging time and programmer confusion. These benefits are especially important given the increasing availability of optimizing compilers. The first half of the dissertation studies the overall problem of debugging optimized programs. It presents a general view of debuggers and defines two important levels of debugger behavior for optimized programs. A debugger provides expected behavior if it hides the effects of the optimizations from the user by doing behind-the-scenes processing. It provides truthful behavior if it indicates that it cannot give the exact answer to a debugging query (because the executing program differs from the source program). The user may be able to deduce the correct answer from the partial information displayed by a truthful response. A thorough study of the interactions between optimization and debugging is included. In addition, a collection of solution techniques to relive the problem caused by optimization are described. The second half of the dissertation implementation experience with one aspect of the problem. A prototype debugging system called Navigator was developed for the Cedar programming environment at the Xerox Palo Alto Research Center. Navigator can be used interactively to monitor program execution flow in the presence of two simple but nontrivial optimizations: inline procedure expansion and cross-jumping (merging identical tails of code paths that join). Navigator provides expected behavior by combining information collected by the compiler about the effects of the optimizations and information collected by the debugger about the control-flow history of the computation. Program execution space and speed are almost total unaffected when no debugging requests are active. When debugging is requested, Navigator provides its added functionality without noticeably degrading debugger response time for most programs. Proofs of correctness of the compiler and debugger algorithms are given, as well as an analysis of their efficiency.

Read the paper · More papers on PaperTik