Debugging Debugging Information Using Dynamic Call Trees
Debugging tools rely on compiler-generated metadata to present a source-language view, but current compilers often throw away or corrupt debugging information in optimised programs. Attempts to test debugging information are confounded by ad-hoc limitations of the debug info formats and a lack of clarity on whether the compiler or the format is to blame for any given loss. Adopting the “residual program” conceptual view of debug info, we conduct a study of the quality of debugging information in respect of the source-level dynamic call trees it can recover. We difference the trees recovered from optimised and unoptimised versions of the same program, producing a classification of the observed divergences. For each class we produce an analysis of whether format or compiler is to blame, and identify specific improvements that can address these defects.