From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F74A3858D39; Fri, 14 Apr 2023 03:19:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F74A3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681442348; bh=jlOjs+kZUStOvUr7/l73j1KVKpQ05hjjqLetrF9S0Aw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wQOZR80q5DnkIKXwxJkrV8iscWpHEg+XHDfq/UbqkSFc4S5thZPukapovOQ0YDBms 84rz8rV6SB4mqTXAtp8tKABoTZNC4Nq5nIK9PeXy8dj+2eLY6cl7NzM+njmWyNTZjz lFbIllnwniVfeWgSUGJMe0MFkn96VgXX3FSdLpTc= 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, 14 Apr 2023 03:19:07 +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 #3 from Tom Tromey --- > It doesn't have a *static* size at all -- it needs the reference's length. Yeah, oops, sorry about that. I guess we need some kind of type resolution that will rewrite the size of the final field in an unsized struct. Unfortunately this doesn't seem to fit that well into how dynamic type resolution is currently handled in gdb. So maybe we need some Rust-specific bit... Ada handles similar(-ish) cases entirely on its own but I think it would be better to somehow hook into the generic code. FWIW I can't gdb 12 to print anything really useful here. You can inspect the data, a bit, but it isn't really obvious and I even get some weird stuff: (gdb) p *a.data_ptr $2 =3D prog::Foo<[u8]> { value: 0 } (gdb) p a.data_ptr.value $3 =3D 97 --=20 You are receiving this mail because: You are on the CC list for the bug.=