public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug rust/30330] New: GDB 13.1 no longer prints length of Rust slice wrappers
@ 2023-04-10 20:45 jistone at redhat dot com
  2023-04-10 21:33 ` [Bug rust/30330] " tromey at sourceware dot org
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: jistone at redhat dot com @ 2023-04-10 20:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30330

            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/a73288371e3fa0a610fbc11e7e8418017bdfde42/tests/debuginfo/unsized.rs#L7-L9

I have reduced it to the following test case compiled with Rust 1.68.2, rustc
-g unsized.rs

    #![allow(unused)]

    #[derive(Debug)]
    struct Foo<T: ?Sized> {
        value: T,
    }

    fn main() {
        let foo: Foo<[u8; 4]> = Foo { value: *b"abc\0" };
        let a: &Foo<[u8]> = &foo;
        dbg!(a);
    }

With GDB 12.1 after stepping to the dbg line, I get:

    (gdb) p a
    $1 = &unsized::Foo<[u8]> {data_ptr: 0x7fffffffd488, length: 4}

With GDB 13.1 on the same executable, I get:

    (gdb) p a
    $1 = &unsized::Foo<[u8]> 0x7fffffffd488

I bisected the change to this commit:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=506ec52e8805d8edd538d6bd11750489a8c8bbee

commit 506ec52e8805d8edd538d6bd11750489a8c8bbee
Author: Tom Tromey <tom@tromey.com>
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=21466
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23871

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-04-02 17:44 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 20:45 [Bug rust/30330] New: GDB 13.1 no longer prints length of Rust slice wrappers jistone at redhat dot com
2023-04-10 21:33 ` [Bug rust/30330] " tromey at sourceware dot org
2023-04-11 11:47 ` tromey at sourceware dot org
2023-04-11 18:52 ` jistone at redhat dot com
2023-04-14  3:19 ` tromey at sourceware dot org
2023-04-14  4:25 ` tromey at sourceware dot org
2023-04-14 15:47 ` jistone at redhat dot com
2023-04-14 22:03 ` tromey at sourceware dot org
2023-07-24 13:48 ` tromey at sourceware dot org
2023-07-28 21:31 ` tromey at sourceware dot org
2023-12-08 16:34 ` michaelwoerister at posteo dot net
2023-12-08 21:34 ` tromey at sourceware dot org
2023-12-08 21:36 ` tromey at sourceware dot org
2023-12-08 21:43 ` tromey at sourceware dot org
2023-12-08 21:49 ` tromey at sourceware dot org
2023-12-11 10:27 ` michaelwoerister at posteo dot net
2023-12-11 10:32 ` michaelwoerister at posteo dot net
2024-01-30 18:24 ` tromey at sourceware dot org
2024-01-30 20:33 ` jistone at redhat dot com
2024-01-31 20:57 ` tromey at sourceware dot org
2024-02-01 19:42 ` tromey at sourceware dot org
2024-02-02 18:20 ` tromey at sourceware dot org
2024-02-02 18:21 ` tromey at sourceware dot org
2024-02-20 20:57 ` cvs-commit at gcc dot gnu.org
2024-02-20 20:58 ` tromey at sourceware dot org
2024-04-02 17:44 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).