This is the mail archive of the
mailing list for the GDB project.
Re: infinite loop processing siblings - dwarf2reader - dwarf 3 debug
- From: Tom Tromey <tromey at redhat dot com>
- To: Jason Richards <jsn dot richards at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 26 Oct 2009 15:13:41 -0600
- Subject: Re: infinite loop processing siblings - dwarf2reader - dwarf 3 debug
- References: <email@example.com>
- Reply-to: tromey at redhat dot com
>>>>> "Jason" == Jason Richards <firstname.lastname@example.org> writes:
Jason> I encountered a problem where GDB gets stuck in an infinite loop
Jason> processing dwarf 3 debug information. Turns out the producer has
Jason> placed a sibling attribute in a die in a comp unit which
Jason> references a previous die in the comp unit.
This does not sound like valid DWARF to me. Section 1.9 makes it sound
as though the only valid value is the DIE's next sibling.
Jason> It seams to me the appropriate fix for this problem is to change
Jason> "locate_pdi_sibling" to first return the location past the
Jason> children, before returning sibling information, which fixes this
Jason> particular problem.
Jason> Is there something I am not thinking about?
I don't know why the code is the way it is; I assume for performance but
I have not looked into it at all.
How about also rejecting a DW_AT_sibling that points to an earlier DIE?