From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 151E3396E874; Fri, 20 Nov 2020 18:00:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 151E3396E874 From: "simark at simark dot ca" 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 18:00:51 +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: simark at simark dot ca 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 18:00:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26875 --- Comment #7 from Simon Marchi --- I am not able to reproduce. In my version of the compiled test case, both bounds are const: (top-gdb) p type->bounds ()->low.kind () $4 =3D PROP_CONST (top-gdb) p type->bounds ()->high.kind () $5 =3D PROP_CONST What compiler do you use to build the test case? In my version, this is the DIE that corresponds to the type of the zero-length field: 0x00000076: DW_TAG_array_type DW_AT_type [DW_FORM_ref4] (0x00000044 "int") DW_AT_sibling [DW_FORM_ref4] (0x00000086) 0x0000007f: DW_TAG_subrange_type DW_AT_type [DW_FORM_ref4] (0x0000003d "long unsigned int") DW_AT_count [DW_FORM_data1] (0x00) So I presume GDB translates that to two constant bounds with value 0. What does it look like in yours? I stumbled on a similar problem and filed this bug here, they are likely related: https://sourceware.org/bugzilla/show_bug.cgi?id=3D26901 I have this patch series in the pipeline that I made to address 26901: https://review.lttng.org/c/binutils-gdb/+/4399/4 If/when I am able to reproduce this (26875) bug, I can check if that helps = with it too. --=20 You are receiving this mail because: You are on the CC list for the bug.=