From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 038153858C5F; Fri, 8 Dec 2023 21:34:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 038153858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702071289; bh=1V6N2XmQaY35SfyZOCu4wOS+3B2tgx7hnsJCXDbo51Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Q/zju1jjy58NzTtoAK4rfwZcd7vVZH0A+sWtb2VXL4dboWbxmVqY/9unf6yMnehTK FJVnZ/r1v9V9hhBAIOHtUTyj6auwaFG3EKM65PdHOycNeA3vpwY3YkeXfUuYe/9tIf 0vj24JjE7Lkn1ZTa0w6QBxEMZHOGwmvEqkbrAJLs= 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, 08 Dec 2023 21:34:48 +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 #10 from Tom Tromey --- The bug with the test case is due to insufficient paranoia in the code to specially handle &str: if (strcmp (type->name (), "&str") =3D=3D 0) val_print_string (base->type ()->target_type (), "UTF-8", value_as_address (base), value_as_long (len), stream, options); Here the bug is that base->type()->target_type() used to be a pointer to the underlying char type, but now it is a 0-length array. If you want to keep data_ptr as an array, we can fix this in gdb. However the earliest the fix could appear is gdb 14.2. If you want this to work for already-released versions of gdb, having data_ptr just be a "C-like" pointer-to-element would be fine. IIRC in this bug the issue with unsized was that data_ptr just had the element type, i.e. 'u8' and not 'u8 *'. --=20 You are receiving this mail because: You are on the CC list for the bug.=