public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: Cary Coutant <ccoutant@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Add extensions to dwarf2.def
Date: Fri, 14 Aug 2015 09:55:00 -0000	[thread overview]
Message-ID: <55CDB9A5.7040305@adacore.com> (raw)
In-Reply-To: <CAJimCsEs2++6EXCgP5m8ZjpMEhW2bJhi4UvOEvOm2hVOuYA=GQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

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." 
(<https://gcc.gnu.org/wiki/DW_AT_GNU_numerator_denominator?action=edit>, 
I'm logged in as pmderodat). Does anyone know how I should proceed?

-- 
Pierre-Marie de Rodat

[-- Attachment #2: 0001-DWARF2-add-extensions-to-handle-fixed-point-types.patch --]
[-- Type: text/x-diff, Size: 1472 bytes --]

From 5b18866caaa8206788baf086c02a7aaf91d555a6 Mon Sep 17 00:00:00 2001
From: Pierre-Marie de Rodat <derodat@adacore.com>
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  <derodat@adacore.com>
+
+	* dwarf2.def (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New
+	attributes.
+
 2015-08-11  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
 	* 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


[-- Attachment #3: 0002-DWARF2-add-extensions-to-handle-biased-types.patch --]
[-- Type: text/x-diff, Size: 1369 bytes --]

From fcddb9fe71187eca4f49576c4f36e5a3d051b669 Mon Sep 17 00:00:00 2001
From: Pierre-Marie de Rodat <derodat@adacore.com>
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  <derodat@adacore.com>
 
+	* dwarf2.def (DW_AT_GNU_bias): New attribute.
+
+2015-08-14  Pierre-Marie de Rodat  <derodat@adacore.com>
+
 	* 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


  reply	other threads:[~2015-08-14  9:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09 10:27 Pierre-Marie de Rodat
2015-08-13 19:02 ` Cary Coutant
2015-08-14  9:55   ` Pierre-Marie de Rodat [this message]
2015-08-18  8:45     ` Pedro Alves
2015-08-18  9:37       ` Manuel López-Ibáñez
2015-08-18 10:25         ` Pierre-Marie de Rodat
2015-08-18 12:16           ` Pedro Alves
2015-08-18 12:39             ` Pierre-Marie de Rodat
2015-08-18 12:49               ` Manuel López-Ibáñez
2015-08-18 13:11                 ` Pierre-Marie de Rodat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CDB9A5.7040305@adacore.com \
    --to=derodat@adacore.com \
    --cc=ccoutant@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).