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

> 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

  reply	other threads:[~2015-08-13 19:01 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 [this message]
2015-08-14  9:55   ` Pierre-Marie de Rodat
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='CAJimCsEs2++6EXCgP5m8ZjpMEhW2bJhi4UvOEvOm2hVOuYA=GQ@mail.gmail.com' \
    --to=ccoutant@gmail.com \
    --cc=derodat@adacore.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).