From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE27C385DC17; Thu, 1 Feb 2024 19:42:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE27C385DC17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706816549; bh=fJHDWwVmcNqoW56mm4jsjhS+bXZmvfyIO+ryYHZ70A4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VRMs2HRxshKwcYmtFkKIVoOuahDn8v5fpL0zFCX9Zr6onZ32Zh/dzkpRpidp/M7Xi Wj/cmMufSCDh8stfgy/0ZRvNXwEnYUINkZeDTaKgREaXQJClokOgaJ5ic0nxfjASy0 XISiRWN6igspnZq8a8aFlX6GydVUPSq8h4f55DeQ= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug rust/30330] GDB 13.1 no longer prints length of Rust slice wrappers Date: Thu, 01 Feb 2024 19:42:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: rust X-Bugzilla-Version: 13.1 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: tromey 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30330 --- Comment #19 from Tom Tromey --- (In reply to Josh Stone from comment #17) > My original example still has that 0 with 1.75: >=20 > <2><1720>: Abbrev Number: 8 (DW_TAG_structure_type) > <1721> DW_AT_name : (strp) (offset: 0xdb5): Foo<[u8]> > <1725> DW_AT_byte_size : (data1) 0 > <1726> DW_AT_alignment : (udata) 1 I figured it out. What happens is that the array that comes at the end of the unsized type is not included in the object size. So if there are no other preceding fields, the size is 0; but if there are preceding fields, the size will be nonzero. This can be detected by looking for a field whose offset is the same as the struct type's size. --=20 You are receiving this mail because: You are on the CC list for the bug.=