From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30329 invoked by alias); 28 Mar 2013 20:46:16 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 30298 invoked by uid 89); 28 Mar 2013 20:46:09 -0000 X-Spam-SWARE-Status: No, score=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 28 Mar 2013 20:46:06 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2SKk3iM015158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Mar 2013 16:46:04 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2SKk2Pm017363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 28 Mar 2013 16:46:02 -0400 From: Tom Tromey To: "Elmenthaler\, Jens" Cc: "gdb\@sourceware.org" Subject: Re: gdb bug or corrupt dwarf info? References: Date: Thu, 28 Mar 2013 20:46:00 -0000 In-Reply-To: (Jens Elmenthaler's message of "Thu, 28 Mar 2013 11:39:41 +0000") Message-ID: <87ip4bb6d1.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-03/txt/msg00083.txt.bz2 >>>>> "Jens" == Elmenthaler, Jens writes: Jens> I'm currently investigation why gdb is only showing 'i' as local Jens> variable in the following loop body, and not also 'text': Jens> So my question now is, whether this is a gdb bug which I possibly Jens> could fix, or whether the debug info is broken. Jens> In my opinion it looks suspicious that the lexical block Jens> containing 'text' is not a child of the lexical block containing Jens> 'i', but a sibling. I am not sure if it is invalid DWARF. There isn't much in DWARF that prohibits odd output like this. Maybe such a prohibition is in there -- I couldn't quickly find it, but that isn't definitive. This DWARF is definitely not what gdb expects. gdb expects lexical blocks to be nested and not to overlap. However, see the "???" comment in read_lexical_block_scope -- there appears to be some room for improvement, though it is unclear to me if trying to handle the DWARF you have is worth the effort. In particular the comment refers to how to handle disjoint ranges, but your problem is both disjoint ranges in one scope combined with an overlap of another scope. I would say that it is both a compiler bug and a gdb bug. The blocks ought to nest, and there doesn't seem to me to be a good reason to use the representation you are seeing. Tom