This is the mail archive of the
mailing list for the GCC project.
Re: [Patch debug] Do not emit debug sections until they are required.
On 6 Nov 2010, at 00:08, Richard Henderson wrote:
On 11/03/2010 06:33 AM, IainS wrote:
This is the only hunk that concerns me. I don't believe that this
is valid dwarf. In particular, a non-empty pubnames implies that
we must have had an info section from which to pull the names.
Did you have a test case that caused you to make this change?
If not, ok with gcc_assert (info_section_emitted).
not a test-case -- but Java achieves it ...
... and with the gcc_assert (), fails to bootstrap on i686-darwin.
Ok, got it.
We generate pubtypes before -feliminate-unused-debug-types does its
thing. So we're putting stuff in pubtypes that are no longer in the
compilation unit. Which is a Bad Thing. I was right about us
emitting invalid dwarf2.
it looks like we have possibly only been doing it when the table was
We should generate pubnames/pubtypes from the final debug_info tree,
rather than trying to emit them earlier.
That looks quite involved (but maybe I miss something).
It seems that checking the the Vec has size > 0 is not enough for
pubtypes (because of the possible elimination).
Would it be sufficient (although another pass through the table :( )
to check that at least one type will be emitted before trying?
Also I note that the
routines check p->die->die_offset != 0 as the condition.
I wonder if that is not supposed to be p->die->die_mark?