From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59549 invoked by alias); 14 Aug 2015 09:49:30 -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 58608 invoked by uid 89); 14 Aug 2015 09:49:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 14 Aug 2015 09:49:28 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 63F9228F184B; Fri, 14 Aug 2015 11:49:25 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1sMfj6RCxpum; Fri, 14 Aug 2015 11:49:25 +0200 (CEST) Received: from [10.10.1.112] (cacatoes.act-europe.fr [10.10.1.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 492C228EBBF8; Fri, 14 Aug 2015 11:49:25 +0200 (CEST) Subject: Re: [PATCH] Add extensions to dwarf2.def To: Cary Coutant References: <5576BB25.50203@adacore.com> Cc: GCC Patches From: Pierre-Marie de Rodat Message-ID: <55CDB9A5.7040305@adacore.com> Date: Fri, 14 Aug 2015 09:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------060207050809050805030400" X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00772.txt.bz2 This is a multi-part message in MIME format. --------------060207050809050805030400 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1893 Cary, Thank you for your answer! On 08/13/2015 09:01 PM, Cary Coutant wrote: > 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. Good idea! I updated the patch accordingly. > 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. Agreed. > 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. Indeed, that's an option, but I find it not very convenient: a new form would require us to enhance all DWARF reading tools whereas adding new tags and attributes is very smooth (not sure this is a good reason, but anyway...). > 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.) That's what I did. >> include/ >> * dwarf2.def (DW_AT_GNU_bias): New attribute. > > This is OK. Looks like a good idea to me. Great. Thank you again! I comitted the two attached (and updated) patches. I will update the corresponding dwarf2out.c changes I submitted on July as well. I also tried to create the new pages on the wiki but it says "You are not allowed to edit this page." (, I'm logged in as pmderodat). Does anyone know how I should proceed? -- Pierre-Marie de Rodat --------------060207050809050805030400 Content-Type: text/x-diff; name="0001-DWARF2-add-extensions-to-handle-fixed-point-types.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-DWARF2-add-extensions-to-handle-fixed-point-types.patch" Content-length: 1473 >From 5b18866caaa8206788baf086c02a7aaf91d555a6 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Tue, 9 Jun 2015 10:31:50 +0200 Subject: [PATCH 1/2] DWARF2: add extensions to handle fixed point types include/ChangeLog: * dwarf2.def (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New attributes. --- include/ChangeLog | 5 +++++ include/dwarf2.def | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/ChangeLog b/include/ChangeLog index 46a4a28..ee59133 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2015-08-14 Pierre-Marie de Rodat + + * dwarf2.def (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New + attributes. + 2015-08-11 Trevor Saunders * ansidecl.h (GCC_FINAL): New macro. diff --git a/include/dwarf2.def b/include/dwarf2.def index e61cfbe..9603c04 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -404,6 +404,10 @@ DW_AT (DW_AT_VMS_rtnbeg_pd_address, 0x2201) See http://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type . */ DW_AT (DW_AT_use_GNAT_descriptive_type, 0x2301) DW_AT (DW_AT_GNAT_descriptive_type, 0x2302) +/* Rational constant extension. + See https://gcc.gnu.org/wiki/DW_AT_GNU_numerator_denominator . */ +DW_TAG (DW_AT_GNU_numerator, 0x2303) +DW_TAG (DW_AT_GNU_denominator, 0x2304) /* UPC extension. */ DW_AT (DW_AT_upc_threads_scaled, 0x3210) /* PGI (STMicroelectronics) extensions. */ -- 2.4.6 --------------060207050809050805030400 Content-Type: text/x-diff; name="0002-DWARF2-add-extensions-to-handle-biased-types.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-DWARF2-add-extensions-to-handle-biased-types.patch" Content-length: 1370 >From fcddb9fe71187eca4f49576c4f36e5a3d051b669 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Tue, 9 Jun 2015 10:31:50 +0200 Subject: [PATCH 2/2] DWARF2: add extensions to handle biased types include/ChangeLog: * dwarf2.def (DW_AT_GNU_bias): New attribute. --- include/ChangeLog | 4 ++++ include/dwarf2.def | 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/ChangeLog b/include/ChangeLog index ee59133..6962f85 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,9 @@ 2015-08-14 Pierre-Marie de Rodat + * dwarf2.def (DW_AT_GNU_bias): New attribute. + +2015-08-14 Pierre-Marie de Rodat + * dwarf2.def (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New attributes. diff --git a/include/dwarf2.def b/include/dwarf2.def index 9603c04..2dfee56 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -408,6 +408,9 @@ DW_AT (DW_AT_GNAT_descriptive_type, 0x2302) See https://gcc.gnu.org/wiki/DW_AT_GNU_numerator_denominator . */ DW_TAG (DW_AT_GNU_numerator, 0x2303) DW_TAG (DW_AT_GNU_denominator, 0x2304) +/* Biased integer extension. + See https://gcc.gnu.org/wiki/DW_AT_GNU_bias . */ +DW_TAG (DW_AT_GNU_bias, 0x2305) /* UPC extension. */ DW_AT (DW_AT_upc_threads_scaled, 0x3210) /* PGI (STMicroelectronics) extensions. */ -- 2.4.6 --------------060207050809050805030400--