]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix gdb FilteringTypePrinter
authorFrançois Dumont <fdumont@gcc.gnu.org>
Wed, 5 Oct 2022 17:24:55 +0000 (19:24 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Wed, 16 Nov 2022 05:53:31 +0000 (06:53 +0100)
commit2b7f0378b915a6a294b330bea00e50069f181bd7
treebabfd2f8267218ad6230f69d4f3efabf8ad7600d
parent63e1b2e767a3f4695373c2406ff719c0a60c1858
libstdc++: Fix gdb FilteringTypePrinter

Once we found a matching FilteringTypePrinter instance we look for the associated
typedef and check that the returned Python Type is equal to the Type to recognize.
But gdb Python Type includes properties to distinguish a typedef from the actual
type. So use gdb.types.get_basic_type to check if we are indeed on the same type.

Additionnaly enhance FilteringTypePrinter matching mecanism by introducing targ1 that,
if not None, will be used as the 1st template parameter.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (FilteringTypePrinter): Rename 'match' field
'template'. Add self.targ1 to specify the first template parameter of the instantiation
to match.
(add_one_type_printer): Add targ1 optional parameter, default to None.
Use gdb.types.get_basic_type to compare the type to recognize and the type
returned from the typedef lookup.
(register_type_printers): Adapt calls to add_one_type_printers.
libstdc++-v3/python/libstdcxx/v6/printers.py
This page took 0.059469 seconds and 6 git commands to generate.