public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug tools/24550] eu-readelf does not know about DW_AT_GNU_{bias,numerator,denumerator}
Date: Wed, 15 May 2019 16:13:00 -0000	[thread overview]
Message-ID: <bug-24550-10460-YFZ3kQw0lu@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24550-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24550

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Mark Wielaard from comment #1)

> Could you help me with creating gnat examples that compile and show their
> usage?

For bias, the above works.

> If I try to compile your example I get two warnings:
> 
> tt.adb:4:04: warning: size clause forces biased representation for "Small"
> tt.adb:8:03: warning: size clause forces biased representation for
> "Repeat_Count_T"
> 
> Are those expected?

Yes, though I don't know the rationale.

The numerator and denominator attributes are used for fixed-point types.
There is a test for this in git@github.com:pmderodat/dwarf-ada-testsuite.git

murgatroyd. readelf -wi tests/fixedpoint/foo.o |grep DW_AT_GNU_[dn]
    <229>   DW_AT_GNU_numerator: 1
    <22a>   DW_AT_GNU_denominator: 30
    <237>   DW_AT_GNU_numerator: 0
    <238>   DW_AT_GNU_denominator: 0


> Also the subranges come out as:
[...]
> There are three things that surprised me about this.
> First that the byte_size is 1, are these types really using a full byte and
> not 2 or 6 bits?

I'm not totally sure what is going on here.  Maybe the type needs to be
used in a packed record to see it actually shrink?  I will see if I can write
a test for this.

> And second that the bias is on the subrange_type and not the base_type. Is
> that intended?

Yes, the bias only applies to subrange types, not the base type.

> Finally, why is the last type signed?

I think that's the default.  You have to request an unsigned based type
explicitly, like:

   type Byte is mod 256;
   type Repeat_Count_T is new Byte range 1 .. 2 ** 6;

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2019-05-15 16:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 17:54 [Bug tools/24550] New: eu-readelf does not know about DW_AT_GNU_bias tromey at sourceware dot org
2019-05-14 18:36 ` [Bug tools/24550] eu-readelf does not know about DW_AT_GNU_{bias,numerator,denumerator} mark at klomp dot org
2019-05-15 16:13 ` tromey at sourceware dot org [this message]
2019-05-15 18:02 ` tromey at sourceware dot org
2019-05-15 18:17 ` tromey at sourceware dot org
2019-05-16 15:17 ` mark at klomp dot org
2019-05-16 15:28 ` mark at klomp dot org

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=bug-24550-10460-YFZ3kQw0lu@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.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).