From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26946 invoked by alias); 19 Feb 2014 07:23:24 -0000 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 Received: (qmail 26935 invoked by uid 89); 19 Feb 2014 07:23:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 19 Feb 2014 07:23:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A15CE11633F; Wed, 19 Feb 2014 02:23:20 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mYnhRLVs5Ys4; Wed, 19 Feb 2014 02:23:20 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4F51411633D; Wed, 19 Feb 2014 02:23:20 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A066FE0EFD; Wed, 19 Feb 2014 08:23:17 +0100 (CET) Date: Wed, 19 Feb 2014 07:23:00 -0000 From: Joel Brobecker To: Mark Wielaard Cc: gdb-patches@sourceware.org Subject: Re: [RFA/DWARF] constant class of DW_AT_high_pc is offset for version >=4 only. Message-ID: <20140219072317.GA4270@adacore.com> References: <1392478818-30320-1-git-send-email-brobecker@adacore.com> <20140218133000.GA15835@adacore.com> <1392739369.21975.145.camel@bordewijk.wildebeest.org> <20140218184906.GB15835@adacore.com> <1392760350.21975.200.camel@bordewijk.wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1392760350.21975.200.camel@bordewijk.wildebeest.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00592.txt.bz2 > Just trying to make up for breaking your setup with my original patch. > Although I might be too pedantic in my DWARF spec reading and I cannot > actually approve the patch. So it might be of little help. Sorry about > that. No - I think you're being very helpful, because you seem very knowledgeable about present and future DWARF. > Sadly DWARF doesn't seem to forbid anything. [...] But even DWARF2 > says that the only possible encoding of attribute values of class > address is DW_FORM_addr. [...] > I admit I am mostly worried because GDB is seen as the gold standard of > DWARF consumers. When GDB accepts some DWARF then basically all other > DWARF consumers have to adapt. [...] > I am just pedantic about interpreting the DWARF standard. Because I do > worry this will make things harder in the future. OK, I see where you are coming from. In that case, I agree we should be adding the complaint. The intention behind my patch then becomes: Yes, we accept this format but its meaning is undefined. We interpret it the best we can hoping that it may actually work in your case, but no guarantees. So, overall, the plan now is to adjust version #2 in the following ways: - Add a comment in the function documentation explaining that this is to help trying to read broken DWARF; - Add a complaint inside the function when the attribute has the wrong format The generalized usage of the new function is maintained. > > > Note that this might break for DWARF5. See http://dwarfstd.org/ShowIssue.php?issue=120719.1 > > > > Interesting. I am curious why you would handle this attribute as > > an offset even when the value is encoded in address form? > > As Doug said, it is a space saving (offsets are often small) and it > saves a relocation (linkers have to resolve all DW_FORM_addr values and > they add up). I was wondering why we don't "simply" require a constant format in this case, instead of allowing both formats. Thanks, -- Joel