>>>> "Mark" == Mark Wielaard
<mjw(a)redhat.com> writes:
Tom> There is no way to distinguish between a CU that does not have a
Tom> corresponding .debug_aranges entry, and a CU that simply has no
Tom> addresses to represent. This is ambiguous because .debug_aranges is an
Tom> optional section.
Tom> This is semi-pathological, and anyway I think we all agreed to just
Tom> ignore it.
Mark> I recently made a change to what gcc outputs for an "address less" CU:
Mark>
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg02286.html
Mark> Such a CU will not have a low_pc attribute. Maybe that helps?
I'm afraid not. The problem, if there is one, has to do with a
missing .debug_aranges entry. That is:
Suppose GDB is reading .debug_aranges. And suppose each time it reads a
new entry in aranges, it matches it to some CU in .debug_info.
Now suppose GDB notices that CU 12340 does not have a .debug_aranges
entry. What does this mean?
It might mean that this CU covers no addresses -- and this would be very
convenient, since it would mean that .debug_aranges is a reliable index
in the sense of being both complete and correct.
But, because .debug_aranges is optional in DWARF, I think this cannot be
distinguished from a bad tool or bad user action. That is, maybe the
user stripped this section from his .o. Or maybe he used some compiler
which does not emit .debug_aranges.
FWIW, at one point I filed a GCC bug about this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42288
Tom