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


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

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?

Tom


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