public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference
@ 2013-02-25 18:33 tfogal at alumni dot unh.edu
  2013-02-25 18:34 ` [Bug gdb/15195] " tfogal at alumni dot unh.edu
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tfogal at alumni dot unh.edu @ 2013-02-25 18:33 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

             Bug #: 15195
           Summary: incorrect pretty-printing of std::tuple when passed by
                    reference or const reference
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: tfogal@alumni.unh.edu
    Classification: Unclassified


Created attachment 6893
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6893
script(1) of the showing the bug in a session.

gdb both from my distro and HEAD of git
(08f46fad0c90ea5579ab4cd913b6bc1506bb4ca7) is incorrectly reporting that a
3-element std::tuple is "empty" when it is passed by reference as an argument
to a function.

I am importing from current svn:

  $ cat ~/.gdbinit
  set print static-members on
  set print vtbl on
  set print demangle on
  set print pretty on
  python
  import sys
  sys.path.insert(0, '/home/tfogal/dev/svn/python')
  from libstdcxx.v6.printers import register_libstdcxx_printers
  register_libstdcxx_printers (None)
  end

which is r196266.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
@ 2013-02-25 18:34 ` tfogal at alumni dot unh.edu
  2013-02-25 18:38 ` tfogal at alumni dot unh.edu
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tfogal at alumni dot unh.edu @ 2013-02-25 18:34 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

--- Comment #1 from tom fogal <tfogal at alumni dot unh.edu> 2013-02-25 18:34:45 UTC ---
Created attachment 6894
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6894
c++ file used to demonstrate bug.  Compile with "g++ -g -Wall -std=c++11
bricknonsense.cpp"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
  2013-02-25 18:34 ` [Bug gdb/15195] " tfogal at alumni dot unh.edu
@ 2013-02-25 18:38 ` tfogal at alumni dot unh.edu
  2013-02-25 18:39 ` tfogal at alumni dot unh.edu
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tfogal at alumni dot unh.edu @ 2013-02-25 18:38 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

tom fogal <tfogal at alumni dot unh.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6894|0                           |1
        is obsolete|                            |

--- Comment #2 from tom fogal <tfogal at alumni dot unh.edu> 2013-02-25 18:38:36 UTC ---
Created attachment 6895
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6895
*actual* C++ file to demonstrate bug.  compile with "g++ -Wall -g -std=c++11
bricknonsense.cpp"

Oops.  Uploaded the wrong version before.  The reference is important!

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
  2013-02-25 18:34 ` [Bug gdb/15195] " tfogal at alumni dot unh.edu
  2013-02-25 18:38 ` tfogal at alumni dot unh.edu
@ 2013-02-25 18:39 ` tfogal at alumni dot unh.edu
  2013-03-21  8:14 ` pmuldoon at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tfogal at alumni dot unh.edu @ 2013-02-25 18:39 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

tom fogal <tfogal at alumni dot unh.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tfogal at alumni dot
                   |                            |unh.edu

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (2 preceding siblings ...)
  2013-02-25 18:39 ` tfogal at alumni dot unh.edu
@ 2013-03-21  8:14 ` pmuldoon at redhat dot com
  2013-03-21 11:49 ` tfogal at alumni dot unh.edu
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2013-03-21  8:14 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmuldoon at redhat dot com

--- Comment #3 from Phil Muldoon <pmuldoon at redhat dot com> 2013-03-21 08:14:14 UTC ---
Thanks for the bug report.  We were not accounting for referenced  values in
the tuple printer.

The patch below will fix the issue (does for me).  If you can, can you see if
it fixes it for you (it should).

I'll be submitting this upstream for review soon


--- /home/pmuldoon/upstream.py    2013-03-21 08:11:42.679947178 +0000
+++ printers.py    2013-03-21 08:10:19.276436649 +0000
@@ -307,7 +307,12 @@
         return self._iterator (self.val)

     def to_string (self):
-        if len (self.val.type.fields ()) == 0:
+        type = self.val.type
+        if type.code == gdb.TYPE_CODE_REF:
+            self.val = self.val.referenced_value()
+            type = self.val.type
+
+        if len(type.fields ()) == 0:
             return 'empty %s' % (self.typename)
         return '%s containing' % (self.typename)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (3 preceding siblings ...)
  2013-03-21  8:14 ` pmuldoon at redhat dot com
@ 2013-03-21 11:49 ` tfogal at alumni dot unh.edu
  2013-03-21 12:12 ` pmuldoon at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tfogal at alumni dot unh.edu @ 2013-03-21 11:49 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

--- Comment #4 from tom fogal <tfogal at alumni dot unh.edu> 2013-03-21 11:49:47 UTC ---
Confirmed fixed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (4 preceding siblings ...)
  2013-03-21 11:49 ` tfogal at alumni dot unh.edu
@ 2013-03-21 12:12 ` pmuldoon at redhat dot com
  2013-03-21 12:13 ` pmuldoon at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2013-03-21 12:12 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (5 preceding siblings ...)
  2013-03-21 12:12 ` pmuldoon at redhat dot com
@ 2013-03-21 12:13 ` pmuldoon at redhat dot com
  2013-08-21  9:04 ` pmuldoon at redhat dot com
  2013-08-21  9:07 ` pmuldoon at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2013-03-21 12:13 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware    |pmuldoon at redhat dot com
                   |dot org                     |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (6 preceding siblings ...)
  2013-03-21 12:13 ` pmuldoon at redhat dot com
@ 2013-08-21  9:04 ` pmuldoon at redhat dot com
  2013-08-21  9:07 ` pmuldoon at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-21  9:04 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

--- Comment #5 from Phil Muldoon <pmuldoon at redhat dot com> ---
I checked in a patch for this yesterday to upstream GCC.  I updated the GCC bug
for this.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53477

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


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

* [Bug gdb/15195] incorrect pretty-printing of std::tuple when passed by reference or const reference
  2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
                   ` (7 preceding siblings ...)
  2013-08-21  9:04 ` pmuldoon at redhat dot com
@ 2013-08-21  9:07 ` pmuldoon at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-21  9:07 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15195

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Phil Muldoon <pmuldoon at redhat dot com> ---
Closing as fixed

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


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

end of thread, other threads:[~2013-08-21  9:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-25 18:33 [Bug gdb/15195] New: incorrect pretty-printing of std::tuple when passed by reference or const reference tfogal at alumni dot unh.edu
2013-02-25 18:34 ` [Bug gdb/15195] " tfogal at alumni dot unh.edu
2013-02-25 18:38 ` tfogal at alumni dot unh.edu
2013-02-25 18:39 ` tfogal at alumni dot unh.edu
2013-03-21  8:14 ` pmuldoon at redhat dot com
2013-03-21 11:49 ` tfogal at alumni dot unh.edu
2013-03-21 12:12 ` pmuldoon at redhat dot com
2013-03-21 12:13 ` pmuldoon at redhat dot com
2013-08-21  9:04 ` pmuldoon at redhat dot com
2013-08-21  9:07 ` pmuldoon at redhat dot com

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).