From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A69A3858C66; Mon, 24 Jul 2023 13:48:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A69A3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690206519; bh=hxwR483NbP0ixhpDP89Cq8KZZjPTtuFRNNan9pJUc5Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qFpaMqLQ3wJF6dggPoSPJfaRXHTtmTvXYK3xbwG6oOXgbI3bst8xJvDaHbKjTsBXT UPf9Iiepzxztjtw/QYGsQHEOgpuY+XcQ30a4F3qHdpIVJKVcl1V9fqslL3UvSBFCvx tg4XKQ5l874Uykjtk5lrGfaZKjluzTGOyxrjpnd4= 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: Mon, 24 Jul 2023 13:48:38 +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 #7 from Tom Tromey --- I found this comment in rust/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs: /// Create debuginfo for `[T]` and `str`. These are unsized. /// /// NOTE: We currently emit just emit the debuginfo for the element type he= re /// (i.e. `T` for slices and `u8` for `str`), so that we end up with /// `*const T` for the `data_ptr` field of the corresponding fat-pointer /// debuginfo of `&[T]`. /// /// It would be preferable and more accurate if we emitted a DIArray of T /// without an upper bound instead. That is, LLVM already supports emitting /// debuginfo of arrays of unknown size. But GDB currently seems to end up /// in an infinite loop when confronted with such a type. I don't recall seeing a report about this infinite loop. I'm not exactly sure how to reproduce it. Anyway I tend to think the rustc debuginfo here is just bad. I'm reluctant to try to work around it. It would be better if the DWARF accurately described what is really being emitted, including some information about where the array bounds can be found dynamically. To implement a workaround here, I guess I'd need to know exactly which fiel= d(s) might have to change from 'T' to 'T[]' to be correct. I don't know how to find this. --=20 You are receiving this mail because: You are on the CC list for the bug.=