From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10E3D3858C20; Fri, 28 Jul 2023 21:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10E3D3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690579906; bh=SPdO+sacpBpahoIRymRrjJdfnBCEqWZkSJ1vquFrmTg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d+A2ExbENdc9womtb3sS9WNOlUca4eOgaJbamU8ipCaohQb+PAEHmmWbCf4csekHI 2W7z23mvssDLQ8h5W6HZsh+VfDlyxYR2T+L8I/zM0kKRUFdaO8OftYvfvHTQuTYltT ZQRMwJ3QTe50JC5r6uunCXAguBzOf2obmvm6KjT0= 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: Fri, 28 Jul 2023 21:31:45 +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 #8 from Tom Tromey --- Unsized types doc'd here: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-size= d-types-and-the-sized-trait I don't know why I keep not understanding this but I think I finally figured it out. (gdb) ptype a type =3D struct &prog::Foo<[u8]> { struct prog::Foo<[u8]> *data_ptr; usize length; } So here, gdb should change the type of 'data_ptr' to 'struct prog::Foo<[u8; ...length...]> *' This can't readily be expressed in DWARF I think. But gdb can apply the change by itself. So then all that remains is fixing up the instance not to use 'u8' (but rather 'u8[]') as the type of the "VLA" part. --=20 You are receiving this mail because: You are on the CC list for the bug.=