From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D9DF3858409; Wed, 20 Oct 2021 22:43:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D9DF3858409 From: "jwakely.gcc at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/28480] New: pretty printing getting confused Date: Wed, 20 Oct 2021 22:43:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jwakely.gcc at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2021 22:43:13 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28480 Bug ID: 28480 Summary: pretty printing getting confused Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: jwakely.gcc at gmail dot com Target Milestone: --- On fedora, with libstdc++-debuginfo installed, and either rawhide's gdb-11 = or a self-built gdb-12 from git. #include #include struct datum { std::string s; int i; }; int main() { std::unique_ptr uptr (new datum); uptr->s =3D "hi bob"; uptr->i =3D 23; std::unique_ptr &ruptr =3D uptr; } $ g++ -g cxx11.cc $ gdb ./a.out GNU gdb (GDB) Fedora 11.1-2.fc36 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./a.out... (gdb) start Temporary breakpoint 1 at 0x40118f: file cxx11.cc, line 13. Starting program: /tmp/a.out=20 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Temporary breakpoint 1, main () at cxx11.cc:13 13 std::unique_ptr uptr (new datum); (gdb) n 14 uptr->s =3D "hi bob"; (gdb)=20 15 uptr->i =3D 23; (gdb)=20 16 std::unique_ptr &ruptr =3D uptr; (gdb) p uptr $1 =3D std::unique_ptr =3D {get() =3D {}} This "" is wrong, it's a datum* pointer, and should be prin= ted as such. This works with GDB 10, but not GDB 11 in rawhide or a self-built GDB 12 fr= om git. --=20 You are receiving this mail because: You are on the CC list for the bug.=