From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68596 invoked by alias); 15 May 2019 16:13:55 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 68542 invoked by uid 48); 15 May 2019 16:13:52 -0000 From: "tromey at sourceware dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: tools X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q2/txt/msg00082.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24550 --- Comment #2 from Tom Tromey --- (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: >=20 > 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" >=20 > 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 a= nd > 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 wri= te 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; --=20 You are receiving this mail because: You are on the CC list for the bug.