[Bug tools/24550] eu-readelf does not know about DW_AT_GNU_{bias,numerator,denumerator}
tromey at sourceware dot org
sourceware-bugzilla@sourceware.org
Wed May 15 16:13:00 GMT 2019
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.
More information about the Elfutils-devel
mailing list