Accurate Coverage Metrics for Compiler-Generated Debugging Information
J. Ryan Stinnett, Stephen Kell
TL;DR
Debug information for optimised code is often incomplete, hindering source-level debugging. The authors introduce a residualisation-based model and a robust, source-line based coverage metric for local variables in DWARF debug info, addressing the limitations of naive instruction-based measures. They implement a static, source-analysis baseline, validate across multiple compilers and codebases through case studies and a replication study, and demonstrate that the metric tracks debuggability changes and explains compiler-induced variations. The approach provides a principled baseline to guide language implementations toward improved debuggability and outlines future work on state-retention in debuggers and automatic residualisation of debug information.
Abstract
Many debugging tools rely on compiler-produced metadata to present a source-language view of program states, such as variable values and source line numbers. While this tends to work for unoptimised programs, current compilers often generate only partial debugging information in optimised programs. Current approaches for measuring the extent of coverage of local variables are based on crude assumptions (for example, assuming variables could cover their whole parent scope) and are not comparable from one compilation to another. In this work, we propose some new metrics, computable by our tools, which could serve as motivation for language implementations to improve debugging quality.
