libstdc++: Use gdb.ValuePrinter base class
commit64f121030135b421d6ec16bf619cb14c50443aff
authorTom Tromey <tromey@adacore.com>
Tue, 26 Sep 2023 19:38:42 +0000 (26 13:38 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 28 Sep 2023 20:55:23 +0000 (28 14:55 -0600)
tree3f1f34fb9f0fc657676e2938babf04c5267f6006
parent98db58eb0b8e78708af0770bac1053fa4fcbc5f4
libstdc++: Use gdb.ValuePrinter base class

GDB 14 will add a new ValuePrinter tag class that will be used to
signal that pretty-printers will agree to the "extension protocol" --
essentially that they will follow some simple namespace rules, so that
GDB can add new methods over time.

A couple new methods have already been added to GDB, to support DAP.
While I haven't implemented these for any libstdc++ printers yet, this
patch makes the basic conversion: printers derive from
gdb.ValuePrinter if it is available, and all "non-standard" (that is,
not specified by GDB) members of the various value-printing classes
are renamed to have a leading underscore.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py: Use gdb.ValuePrinter
everywhere.  Rename members to start with "_".
libstdc++-v3/python/libstdcxx/v6/printers.py