From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29599 invoked by alias); 26 Oct 2009 21:50:42 -0000 Received: (qmail 29590 invoked by uid 22791); 26 Oct 2009 21:50:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Oct 2009 21:50:35 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id CD81A10E87; Mon, 26 Oct 2009 21:50:32 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 838E41086C; Mon, 26 Oct 2009 21:50:32 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1N2XSR-0007CM-Ew; Mon, 26 Oct 2009 17:50:31 -0400 Date: Mon, 26 Oct 2009 21:50:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: Jason Richards , gdb-patches@sourceware.org Subject: Re: infinite loop processing siblings - dwarf2reader - dwarf 3 debug Message-ID: <20091026215031.GA27627@caradoc.them.org> Mail-Followup-To: Tom Tromey , Jason Richards , gdb-patches@sourceware.org References: <9c25d2960910242124p6dfc4f6an72811d4105711fa2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00653.txt.bz2 On Mon, Oct 26, 2009 at 03:13:41PM -0600, Tom Tromey wrote: > >>>>> "Jason" == Jason Richards 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