From b46ed6f65e01aa5b7f5aba08fed879da289c5ba5 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 15 Jan 2018 12:38:56 +0000 Subject: [PATCH] Fix type printers for Library Fundamentals types * python/libstdcxx/v6/printers.py (register_type_printers): Remove printer for experimental::any. Fix printers for experimental::optional and experimental::basic_string_view. From-SVN: r256699 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/python/libstdcxx/v6/printers.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d67a0000005e..8db45525a7d6 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2018-01-15 Jonathan Wakely + * python/libstdcxx/v6/printers.py (register_type_printers): Remove + printer for experimental::any. Fix printers for experimental::optional + and experimental::basic_string_view. + Backport from mainline 2018-01-04 Jonathan Wakely diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 040715a9073c..ec3feafc5ded 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -1154,7 +1154,7 @@ class TemplateTypePrinter(object): Recognizes type names that match a regular expression. Replaces them with a formatted string which can use replacement field {N} to refer to the \N subgroup of the regex match. - Type printers are recusively applied to the subgroups. + Type printers are recursively applied to the subgroups. This allows recognizing e.g. "std::vector<(.*), std::allocator<\\1> >" and replacing it with "std::vector<{1}>", omitting the template argument @@ -1335,10 +1335,10 @@ def register_type_printers(obj): # strip the "fundamentals_v1" inline namespace from these types add_one_template_type_printer(obj, 'optional', 'experimental::fundamentals_v1::optional<(.*)>', - 'experimental::optional<\\1>') + 'experimental::optional<{1}>') add_one_template_type_printer(obj, 'basic_string_view', 'experimental::fundamentals_v1::basic_string_view<(.*), std::char_traits<\\1> >', - 'experimental::basic_string_view<\\1>') + 'experimental::basic_string_view<{1}>') def register_libstdcxx_printers (obj): "Register libstdc++ pretty-printers with objfile Obj." -- 2.47.2