This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: infinite loop processing siblings - dwarf2reader - dwarf 3 debug


 On Mon, Oct 26, 2009 at 03:13:41PM -0600, Tom Tromey wrote:
> >>>>> "Jason" == Jason Richards <jsn.richards@gmail.com> 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.

That's right.  What is this producer?

> 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.

You are correct.  This optimization is the point of DW_AT_sibling, in
fact.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]