Here, I recommend simply searching for "GCC" in
src/gdb/dwarf2read.c.
This will yield a number of PRs (some open, some closed) and other
oddities.
Searching through the "debug" bugs in GCC bugzilla would also yield some
stuff.
Ok. Petr can do that in some spare time. But please do make us aware
explicitly of anything that you come across.
check_debug_aranges
We saw cases in the wild where an arange entry was terminated early.
That is, the 0,0 entry occurred before the end of the particular
arange buffer. There is a bug, maybe closed, in Red Hat bugzilla for
this.
Consider checking that every CU has an arange entry.
This is not strictly required, but it is nicer for consumers.
ISTR filing a bug about this in GCC bugzilla.
I think this comes under what we call "connectivity" checks, and might be
done already. .debug_aranges should be deriveable from scratch from the
DIE trees (and our writer/compressor will always do that and ignore the
original contents). So I think we already intend to compare the data
completely to what we would build from scratch. Petr should know if any
parts of that checking are still missing.
check_debug_pubnames / pubtypes
FWIW, GCC doesn't emit these any more. So, IMO anyway, they are not
very important to check. They were never all that usable in the first
place.
But, if you want to check these, then check that they are complete and
correct.
We have multiple levels of checks. For these, we may only ever bother with
the low-level checks, i.e. that the section formats themselves are valid
and that their DIE pointers are valid pointers. The high-level "correct"
predicate is not a DWARF thing, but an issue of language-specific semantics.
So far, all of our stuff is only on pure language-agnostic and producer-blind
DWARF specification requirements.
In the past we noticed that names were not always fully qualified
(I
forget if it was namespace- or class- qualification that GCC didn't do
properly). I'm sure I filed a GCC bug for this.
We are far off from having anything like the language-specific knowledge
modules we'd need to detect that.
Thanks,
Roland