(This is additional detail for one of two metrics in a recent LLVM RFC. The ideas here were proposed by Stephen Livermore-Tozer.)
In addition to a variable coverage metric (described in our RFC elsewhere), we also plan to measure per-variable line table coverage as well. This is particularly useful for disambiguating cases where the above variable coverage metric shows less than 100% coverage. By also checking line table coverage for the same variable, it becomes clear whether the missing variable coverage is due to source lines missing from the line table or instructions missing from variable location ranges.
For the variable v
and build configuration o
, we have S(v)
is the set of source lines in v
's scope at which it is defined, and B(o,v)
is the subset of S(v)
at which v
has a value described by debug info when built with o
. Our per-variable coverage metric is then
C(o,v) = |B(o,v)| / |S(v)|