]> 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)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 20 Mar 2023 11:52:18 +0000 (11:52 +0000)
commit0970eafdc61d750b0b0c8c10c466a506be9583a1
treeb69aa84c3978fea47c287811a50c5a889e38ba44
parent0a6e26e79798057301e5e2f56e89aec65e83161c
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.

(cherry picked from commit 2b7f0378b915a6a294b330bea00e50069f181bd7)
libstdc++-v3/python/libstdcxx/v6/printers.py
This page took 0.067803 seconds and 6 git commands to generate.