Non-Transparent Debugging of Optimized Code

Abstract

Debugging optimized code is a problem for which a widely accepted solution has yet to be found. Over the years many approaches have been suggested, including limiting the compiler optimizations, restricting the debugger functionality, using recompilation or dynamic de-optimization to undo the optimizations, and having the debugger determine the effects of optimizations and mask them from the user. All of these approaches have a common thread: they place a barrier between the user and the optimizations, either altering, undoing, or hiding the effects of optimizations. This work presents a completely different approach. By allowing users to see some of the effects of optimizations, many of the problems traditionally associated with debugging optimized code are either simplified or eliminated. The basic idea is to generate an optimized version of the source program, which accurately reflects the effects of the compiler optimizations. The user and the debugger then communicate via this optimized source program. The theoretical issues involved in generating optimized source code, as well as the compiler support necessary for debugging optimized code are presented in this work. It also explores options for displaying the optimized source program to the user in the most useful, least confusing manner. It introduces the concept of key instructions and shows how they are critical for simplifying determining current variable locations within the executable, and mapping accurately between binary instructions and statements in the optimized source program. It also presents a pioneering approach for eviction recovery within the debugger. These ideas have been fully implemented in Optview and Optdbx, which are described in this dissertation. Optview is a prototype tool that generates optimized source code for C programs. It is embedded within the SGI MIPS-Pro 7.2 C compiler. Optdbx is a modified version of the SGI dbx debugger, which makes use of the optimized source code.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Nov 01, 1999
Accession Number
ADA603890

Entities

People

  • Caroline M. Tice

Organizations

  • University of California, Berkeley

Tags

Communities of Interest

  • Advanced Electronics
  • Energy and Power Technologies
  • Materials and Manufacturing Processes

DTIC Thesaurus Topics

  • Application Software
  • Compilers
  • Computer Programming
  • Computer Programs
  • Computer Science
  • Computers
  • Debugging
  • Graphical User Interface
  • Machine Languages
  • Object Code
  • Operating Systems
  • Programming Languages
  • Prototypes
  • Python Programming Language
  • Software Development
  • User Interface

Fields of Study

  • Computer science

Readers

  • Computer Science.
  • Database Systems and Applications
  • Systems Analysis and Design