public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/28480] New: pretty printing getting confused
@ 2021-10-20 22:43 jwakely.gcc at gmail dot com
  2021-10-21  0:44 ` [Bug gdb/28480] " jwakely.gcc at gmail dot com
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: jwakely.gcc at gmail dot com @ 2021-10-20 22:43 UTC (permalink / raw)
  To: gdb-prs

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

            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 <memory>
#include <string>

struct datum
{
  std::string s;
  int i;
};

int
main()
{
  std::unique_ptr<datum> uptr (new datum);
  uptr->s = "hi bob";
  uptr->i = 23;
  std::unique_ptr<datum> &ruptr = 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 <http://gnu.org/licenses/gpl.html>
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:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

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 
[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<datum> uptr (new datum);
(gdb) n
14        uptr->s = "hi bob";
(gdb) 
15        uptr->i = 23;
(gdb) 
16        std::unique_ptr<datum> &ruptr = uptr;
(gdb) p uptr
$1 = std::unique_ptr<datum> = {get() = {<No data fields>}}


This "<No data fields>" is wrong, it's a datum* pointer, and should be printed
as such.

This works with GDB 10, but not GDB 11 in rawhide or a self-built GDB 12 from
git.

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

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

end of thread, other threads:[~2021-12-11  7:49 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 22:43 [Bug gdb/28480] New: pretty printing getting confused jwakely.gcc at gmail dot com
2021-10-21  0:44 ` [Bug gdb/28480] " jwakely.gcc at gmail dot com
2021-10-21  0:49 ` jwakely.gcc at gmail dot com
2021-10-21  0:56 ` jwakely.gcc at gmail dot com
2021-10-21  3:23 ` simark at simark dot ca
2021-10-21  8:44 ` jwakely.gcc at gmail dot com
2021-10-26 19:14 ` blarsen at redhat dot com
2021-11-04 16:01 ` blarsen at redhat dot com
2021-11-04 16:52 ` jwakely.gcc at gmail dot com
2021-11-04 17:06 ` jwakely.gcc at gmail dot com
2021-11-04 17:09 ` jwakely.gcc at gmail dot com
2021-11-04 17:36 ` jwakely.gcc at gmail dot com
2021-11-04 17:42 ` jwakely.gcc at gmail dot com
2021-11-04 17:53 ` jwakely.gcc at gmail dot com
2021-11-04 17:56 ` simark at simark dot ca
2021-11-04 17:59 ` simark at simark dot ca
2021-11-04 18:07 ` blarsen at redhat dot com
2021-11-04 18:45 ` pedro at palves dot net
2021-11-04 19:40 ` blarsen at redhat dot com
2021-11-05 13:53 ` blarsen at redhat dot com
2021-11-05 14:29 ` [Bug c++/28480] Incorrect field ambiguity detection due to [[no_unique_address]] simark at simark dot ca
2021-11-25 12:56 ` cvs-commit at gcc dot gnu.org
2021-11-25 15:25 ` blarsen at redhat dot com
2021-12-11  7:49 ` 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).