From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD4053858D38; Mon, 10 Apr 2023 20:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD4053858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681159510; bh=NpA+ccffETLPjKLNyLrNsjGuG1Q8EUqXJ/5vv4Evgu8=; h=From:To:Subject:Date:From; b=kC7bFohhlUPUVgovrIgJhMTnHe6JtIqSzvvdy+bHRCnWInkjeV9p2+qaOqxeEaEJM bJq+jA4CYtK67wPp6roHkjjldZmRdy9ISgXiuCnpuJI7ZdCkqyt7dU8JLZt8+XnhyJ C86qffhPks6AHLtag5WAKPJvZ5wImPJUtyKZf1b8= From: "jistone at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug rust/30330] New: GDB 13.1 no longer prints length of Rust slice wrappers Date: Mon, 10 Apr 2023 20:45:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: jistone at redhat dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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 Bug ID: 30330 Summary: GDB 13.1 no longer prints length of Rust slice wrappers Product: gdb Version: 13.1 Status: NEW Severity: normal Priority: P2 Component: rust Assignee: unassigned at sourceware dot org Reporter: jistone at redhat dot com CC: tromey at sourceware dot org Target Milestone: --- GDB 13.1 has regressed in the Rust debuginfo testsuite here: https://github.com/rust-lang/rust/blob/a73288371e3fa0a610fbc11e7e8418017bdf= de42/tests/debuginfo/unsized.rs#L7-L9 I have reduced it to the following test case compiled with Rust 1.68.2, rus= tc -g unsized.rs #![allow(unused)] #[derive(Debug)] struct Foo { value: T, } fn main() { let foo: Foo<[u8; 4]> =3D Foo { value: *b"abc\0" }; let a: &Foo<[u8]> =3D &foo; dbg!(a); } With GDB 12.1 after stepping to the dbg line, I get: (gdb) p a $1 =3D &unsized::Foo<[u8]> {data_ptr: 0x7fffffffd488, length: 4} With GDB 13.1 on the same executable, I get: (gdb) p a $1 =3D &unsized::Foo<[u8]> 0x7fffffffd488 I bisected the change to this commit: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D506ec52e8805= d8edd538d6bd11750489a8c8bbee commit 506ec52e8805d8edd538d6bd11750489a8c8bbee Author: Tom Tromey Date: Fri Mar 25 13:36:53 2022 -0600 Reimplement Rust slice printing The current nightly Rust compiler (aka 1.61) added better DWARF representation for unsized types. Fixing this is PR rust/21466; but the code is actually the same as what is required to make slice printing more useful, which is PR rust/23871. This patch implements this. I tested this against various Rust compilers: 1.48, current stable, current beta, and current nightly. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D21466 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D23871 --=20 You are receiving this mail because: You are on the CC list for the bug.=