public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose
@ 2023-08-08 10:22 sebastian.redl at getdesigned dot at
2023-08-08 10:33 ` [Bug libstdc++/110944] " redi at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: sebastian.redl at getdesigned dot at @ 2023-08-08 10:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
Bug ID: 110944
Summary: std::variant & optional GDB representation is too
verbose
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: sebastian.redl at getdesigned dot at
Target Milestone: ---
The key lines of the GDB visualizers for std::variant and std::optional look
like this:
return "%s [no contained value]" % self.typename
Note that this contains the full typename of the object.
We use lots of optionals of Boost.Units types, which have *huge* types. Here's
a small snippet of output when I attempt to print a value:
landing_mass_ =
std::optional<boost::units::quantity<boost::units::unit<boost::units::list<boost::units::dim<boost::units::mass_base_dimension,
boost::units::static_rational<1, 1> >, boost::units::dimensionless_type>,
boost::units::homogeneous_system<boost::units::list<boost::units::si::meter_base_unit,
boost::units::list<boost::units::scaled_base_unit<boost::units::cgs::gram_base_unit,
boost::units::scale<10, boost::units::static_rational<3, 1> > >,
boost::units::list<boost::units::si::second_base_unit,
boost::units::list<boost::units::si::ampere_base_unit,
boost::units::list<boost::units::si::kelvin_base_unit,
boost::units::list<boost::units::si::mole_base_unit,
boost::units::list<boost::units::si::candela_base_unit,
boost::units::list<boost::units::angle::radian_base_unit,
boost::units::list<boost::units::angle::steradian_base_unit,
boost::units::dimensionless_type> > > > > > > > > >, void>, double>> =
{[contained value] = 45359.237000000001}
Note that this is just one field of a struct with many fields (quite a few of
them optionals of unit types), and the value I'm printing is a vector of
multiple such structs, and the type is repeated for every single instance of an
optional.
It is, in short, not useful; in fact it makes the debug output completely
unusable.
Please just remove it. If I need to know the type of something, I can easily
look it up in the source code if I'm unsure about them. The debugger needs to
focus on runtime values, which I cannot look up.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
@ 2023-08-08 10:33 ` redi at gcc dot gnu.org
2023-08-23 11:13 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-08 10:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-08-08
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
2023-08-08 10:33 ` [Bug libstdc++/110944] " redi at gcc dot gnu.org
@ 2023-08-23 11:13 ` redi at gcc dot gnu.org
2023-08-24 12:41 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-23 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
2023-08-08 10:33 ` [Bug libstdc++/110944] " redi at gcc dot gnu.org
2023-08-23 11:13 ` redi at gcc dot gnu.org
@ 2023-08-24 12:41 ` cvs-commit at gcc dot gnu.org
2023-08-24 12:43 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-24 12:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:701ce3c723623af13597c05df09a049c57c52fc0
commit r14-3451-g701ce3c723623af13597c05df09a049c57c52fc0
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Aug 22 14:26:51 2023 +0100
libstdc++: Declutter std::optional and std:variant pretty printers
[PR110944]
As the PR says, including the template arguments in the GDB output of
these class templates can result in very long names, especially for
std::variant. You can use 'whatis' or other GDB commands to get details
of the type, we don't need to include it in the value.
We could consider including the type if it's not too long, but I think
consistency is better (and we already omit the template arguments for
std::vector and other class templates).
libstdc++-v3/ChangeLog:
PR libstdc++/110944
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Do
not show template arguments.
(StdVariantPrinter): Likewise.
* testsuite/libstdc++-prettyprinters/compat.cc: Adjust expected
output.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
` (2 preceding siblings ...)
2023-08-24 12:41 ` cvs-commit at gcc dot gnu.org
@ 2023-08-24 12:43 ` redi at gcc dot gnu.org
2023-11-13 15:44 ` cvs-commit at gcc dot gnu.org
2023-11-13 16:47 ` redi at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-24 12:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.0
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on trunk, thanks for the suggestion.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
` (3 preceding siblings ...)
2023-08-24 12:43 ` redi at gcc dot gnu.org
@ 2023-11-13 15:44 ` cvs-commit at gcc dot gnu.org
2023-11-13 16:47 ` redi at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-13 15:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:
https://gcc.gnu.org/g:3a3d3d2361e3c44dad472a5a12318cba19b6e643
commit r13-8047-g3a3d3d2361e3c44dad472a5a12318cba19b6e643
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Aug 22 14:26:51 2023 +0100
libstdc++: Declutter std::optional and std:variant pretty printers
[PR110944]
As the PR says, including the template arguments in the GDB output of
these class templates can result in very long names, especially for
std::variant. You can use 'whatis' or other GDB commands to get details
of the type, we don't need to include it in the value.
We could consider including the type if it's not too long, but I think
consistency is better (and we already omit the template arguments for
std::vector and other class templates).
libstdc++-v3/ChangeLog:
PR libstdc++/110944
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Do
not show template arguments.
(StdVariantPrinter): Likewise.
* testsuite/libstdc++-prettyprinters/compat.cc: Adjust expected
output.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
(cherry picked from commit 701ce3c723623af13597c05df09a049c57c52fc0)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/110944] std::variant & optional GDB representation is too verbose
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
` (4 preceding siblings ...)
2023-11-13 15:44 ` cvs-commit at gcc dot gnu.org
@ 2023-11-13 16:47 ` redi at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-13 16:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110944
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|14.0 |13.3
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've backported this for 13.3 as well.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-11-13 16:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 10:22 [Bug libstdc++/110944] New: std::variant & optional GDB representation is too verbose sebastian.redl at getdesigned dot at
2023-08-08 10:33 ` [Bug libstdc++/110944] " redi at gcc dot gnu.org
2023-08-23 11:13 ` redi at gcc dot gnu.org
2023-08-24 12:41 ` cvs-commit at gcc dot gnu.org
2023-08-24 12:43 ` redi at gcc dot gnu.org
2023-11-13 15:44 ` cvs-commit at gcc dot gnu.org
2023-11-13 16:47 ` redi 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).