From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6B0A3972428; Fri, 20 Nov 2020 22:16:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6B0A3972428 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug exp/26875] Incorrect value printed for address of first element of zero-length array Date: Fri, 20 Nov 2020 22:16:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: exp X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.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-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 22:16:22 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26875 --- Comment #11 from Tom de Vries --- (In reply to Simon Marchi from comment #7) > I am not able to reproduce. In my version of the compiled test case, both > bounds are const: >=20 > (top-gdb) p type->bounds ()->low.kind () > $4 =3D PROP_CONST > (top-gdb) p type->bounds ()->high.kind () > $5 =3D PROP_CONST >=20 > What compiler do you use to build the test case? Gcc 7.5.0 > In my version, this is the > DIE that corresponds to the type of the zero-length field: >=20 > 0x00000076: DW_TAG_array_type > DW_AT_type [DW_FORM_ref4] (0x00000044 "int") > DW_AT_sibling [DW_FORM_ref4] (0x00000086) >=20 > 0x0000007f: DW_TAG_subrange_type > DW_AT_type [DW_FORM_ref4] (0x0000003d "long unsigned > int") > DW_AT_count [DW_FORM_data1] (0x00) >=20 I get: ... <1><13a>: Abbrev Number: 2 (DW_TAG_array_type) <13b> DW_AT_type : <0x10b> <13f> DW_AT_sibling : <0x149> <2><143>: Abbrev Number: 9 (DW_TAG_subrange_type) <144> DW_AT_type : <0x104> ... without DW_AT_count. The DW_AT_count is added at gcc-9, and using that the test-cases passes for= me. > So I presume GDB translates that to two constant bounds with value 0. Wh= at > does it look like in yours? >=20 > I stumbled on a similar problem and filed this bug here, they are likely > related: >=20 > https://sourceware.org/bugzilla/show_bug.cgi?id=3D26901 >=20 > I have this patch series in the pipeline that I made to address 26901: >=20 > https://review.lttng.org/c/binutils-gdb/+/4399/4 >=20 Ah, thanks for the pointer, I'll take a look. > If/when I am able to reproduce this (26875) bug, I can check if that helps > with it too. That would be great. --=20 You are receiving this mail because: You are on the CC list for the bug.=