[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-11-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

--- Comment #6 from Jonathan Wakely  ---
OK, thanks for following up.

[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-11-19 Thread leo.terziman at clarte dot asso.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

Léo Terziman  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Léo Terziman  ---
Sorry for the late response.

As you can see, I submitted this bug 5 years ago. As you can imagine, I do not
remember exactly the details of such bug, as well as how to reproduce it. In
any case, I highly doubt this bug is still present in the current version of
gcc, as lot of things changed since then...

If you can not reproduce it with the current version of gcc, I guess the bug is
resolved and should be marked as such.

[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-11-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška  ---
Can the bug be marked as resolved?

[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-07-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

--- Comment #3 from Jonathan Wakely  ---
Is it possible you were using a really old version of GDB that doesn't
understand the display hint?

def display_hint (self):
return 'map'

That causes GDB to display:

$1 = std::map with 3 elements = {["bar"] = 2, ["baz"] = 3, ["foo"] = 1}

instead of:

$1 = std::map with 3 elements = {[0] = "bar", [1] = 2, [2] = "baz", [3] = 3,
[4] = "foo", [5] = 1}

[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-07-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-07-31
 Ever confirmed|0   |1

--- Comment #2 from Jonathan Wakely  ---
(In reply to Léo Terziman from comment #0)
> Moreover, in std::map, the keys and
> values are mixed together in the same list instead of producing a list of
> pairs with 'first' and 'second' attributes.

I don't know what you mean by "mixed together in the same list", they are
printed as [key] = value, [key] = value, [key] = value e.g.

$1 = std::map with 3 elements = {["bar"] = 2, ["baz"] = 3, ["foo"] = 1}


With your patch I get:

$1 = std::map with 3 elements = {[{first = "bar", second = 2}] = {first =
"baz", second = 3}, [{first = "foo", second = 1}] = }

This is not an improvement!


The smart pointer printers have been improved for gcc-8, do you still think
something needs to be changed?

[Bug libstdc++/59253] Python pretty printer should be improved for unique_ptr, shared_ptr and map

2018-01-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59253

--- Comment #1 from Jonathan Wakely  ---
Author: redi
Date: Tue Jan  9 18:49:57 2018
New Revision: 256390

URL: https://gcc.gnu.org/viewcvs?rev=256390=gcc=rev
Log:
PR libstdc++/59253 Improve pretty printers for smart pointers

PR libstdc++/59253 (partial)
* python/libstdcxx/v6/printers.py (SmartPtrIterator): Common iterator
type for pointer stored by shared_ptr, weak_ptr and unique_ptr.
(SharedPointerPrinter, UniquePointerPrinter): Treat stored values as
children.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Update expected output
of unique_ptr printer.
* testsuite/libstdc++-prettyprinters/shared_ptr.cc: Update expected
output of shared_ptr printer.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/python/libstdcxx/v6/printers.py
trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc