From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124703 invoked by alias); 13 Aug 2015 19:01:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 124677 invoked by uid 89); 13 Aug 2015 19:01:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f53.google.com Received: from mail-vk0-f53.google.com (HELO mail-vk0-f53.google.com) (209.85.213.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 13 Aug 2015 19:01:25 +0000 Received: by vkhl6 with SMTP id l6so21115666vkh.1 for ; Thu, 13 Aug 2015 12:01:23 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.92.65 with SMTP id ck1mr44879207vdb.23.1439492482912; Thu, 13 Aug 2015 12:01:22 -0700 (PDT) Received: by 10.31.31.23 with HTTP; Thu, 13 Aug 2015 12:01:22 -0700 (PDT) In-Reply-To: <5576BB25.50203@adacore.com> References: <5576BB25.50203@adacore.com> Date: Thu, 13 Aug 2015 19:02:00 -0000 Message-ID: Subject: Re: [PATCH] Add extensions to dwarf2.def From: Cary Coutant To: Pierre-Marie de Rodat Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00732.txt.bz2 > I'm currently working on migrating debugging information for Ada from GNAT > encodings to standard DWARF. At the moment, I have worked on two topics that > I believe are not (completely) supported in standard DWARF: > > - fixed point types with arbitrary scale factors; > - scalar types with biased representations. > > My goal is to submit an issue on dwarfstd.org in an attempt to introduce > these extensions to the next DWARF standard. Before that, though, I would > like to make sure that these extensions actually fit the need by having them > supported both in GCC and GDB. > > The two attached patches make these extensions "public" so that no other > vendor-specific tags/attributes conflict with them in the future. I cannot > submit the patches that actually use these right now because I need first to > port them from the 4.9 branch onto mainline (I hope I will be able to do > this on early July). > > May I commit them? > > I also attached two documents that describe how to use these extensions. I > guess this should go to the wiki just like for DW_AT_GNAT_descriptive_type > (https://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type). I will do this if > the patches are integrated. > > Thank you in advance! > > include/ > * dwarf2.def (DW_TAG_GNU_rational_constant): New tag. > (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New attributes. I don't think you really need a new TAG here -- DW_TAG_constant could just as easily take DW_AT_GNU_numerator and DW_AT_GNU_denominator as an alternative to DW_AT_const_value. I'm not really sure why DW_AT_small was defined to refer to a DW_TAG_constant DIE rather than just providing the constant as the attribute value. It would seem more efficient, space-wise, to have a DW_AT_scale attribute that would provide a multiplicative scale factor, and an optional DW_AT_scale_divisor to provide the denominator if necessary. Another, perhaps far-fetched, alternative would be to introduce a new form that would represent a rational constant as two unsigned LEB128 values, and allow that form for DW_AT_const_value and/or for DW_AT_small. For now, I'd suggest going with your proposal, except use the existing DW_TAG_constant instead of a new TAG. (I.e., just add the two new DW_AT_numerator and DW_AT_denominator attributes.) > include/ > * dwarf2.def (DW_AT_GNU_bias): New attribute. This is OK. Looks like a good idea to me. -cary