From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62758 invoked by alias); 26 Oct 2017 20:19:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 62736 invoked by uid 89); 26 Oct 2017 20:19:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:basic_s, restoring, fundamentals, Fundamentals X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 20:19:16 +0000 Received: by mail-wr0-f175.google.com with SMTP id k62so4312001wrc.9; Thu, 26 Oct 2017 13:19:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=nRGdu44H42MhxHkaNpJJ/4KvMcu/ys4SYRc3SOeptbI=; b=RUkx7hAa+BhWrZ1HRjMBbBB+AIF+yxgJ5ObjQgv5NB5bF5s88onE9gACe+MnoKern5 9blx3tRrj+D6z9HZYHCukAhI4Vp8+KNiQf+EBCGqQjaxjmK0JsuJ8rQJ899IRR6wJdsb HPEz/deXcfomBv4cEWoPWZc0Dpo2zD86sFBhX0oRgEz4N9fGz+Wcj/Kr8I7EdGrk9u5v scaCogAYDFEkFpQjMIG35fWkq32yxn4lD3YBOeVAg93SVLeTXByJXDPnM6UAO1+f7yPi uT7mshOqJkraRqPFdapClqFKJSO5pD6KQqLlKldFDpRfFij75DRUMQOrCCeWiQytrcKc c43w== X-Gm-Message-State: AMCzsaVzCSTuvkFeq0gqsLdymkncKxQiOsUSWs8fRd8JsDQri5CVz3yq jWxNCWg8is8Syc85TYseOpbY6A== X-Google-Smtp-Source: ABhQp+TCfqa5w/M2O94sfgvbN00fxCmUmTn7OoWNNISntR21I63pEinPIP2uKJV0f6pKTr3clpb4LA== X-Received: by 10.223.143.51 with SMTP id p48mr5954128wrb.104.1509049153701; Thu, 26 Oct 2017 13:19:13 -0700 (PDT) Received: from [192.168.0.23] (arf62-1-82-237-250-248.fbx.proxad.net. [82.237.250.248]) by smtp.googlemail.com with ESMTPSA id p78sm137305wma.11.2017.10.26.13.19.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 13:19:11 -0700 (PDT) To: "libstdc++@gcc.gnu.org" , gcc-patches From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Subject: Fix pretty printers for versioned namespace Message-ID: <29900c34-03ae-453d-3e96-401620b4f5c8@gmail.com> Date: Thu, 26 Oct 2017 20:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------900F0DB0B3B24026B891BCFC" X-SW-Source: 2017-10/txt/msg02002.txt.bz2 This is a multi-part message in MIME format. --------------900F0DB0B3B24026B891BCFC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-length: 257 Hi     When restoring versioned namespace feature I forgot to check for the pretty printer tests which are now broken.     Here is the patch to fix those. Tested under Linux x86_64 normal and versioned namepace modes, ok to commit ? François --------------900F0DB0B3B24026B891BCFC Content-Type: text/x-patch; name="printers.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="printers.patch" Content-length: 6571 diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index b7b2a0f..0a168fe 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -973,8 +973,8 @@ class StdExpAnyPrinter(SingleObjContainerPrinter): "Print a std::any or std::experimental::any" def __init__ (self, typename, val): - self.typename = re.sub('^std::experimental::fundamentals_v\d::', 'std::experimental::', typename, 1) - self.typename = strip_versioned_namespace(self.typename) + self.typename = strip_versioned_namespace(typename) + self.typename = re.sub('^std::experimental::fundamentals_v\d::', 'std::experimental::', self.typename, 1) self.val = val self.contained_type = None contained_value = None @@ -1021,8 +1021,8 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter): def __init__ (self, typename, val): valtype = self._recognize (val.type.template_argument(0)) - self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1) - self.typename = strip_versioned_namespace(self.typename) + self.typename = strip_versioned_namespace(typename) + self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, self.typename, 1) if not self.typename.startswith('std::experimental'): val = val['_M_payload'] self.val = val @@ -1043,8 +1043,8 @@ class StdVariantPrinter(SingleObjContainerPrinter): def __init__(self, typename, val): alternatives = self._template_args(val) - self.typename = "%s<%s>" % (typename, ', '.join([self._recognize(alt) for alt in alternatives])) - self.typename = strip_versioned_namespace(self.typename) + self.typename = strip_versioned_namespace(typename) + self.typename = "%s<%s>" % (self.typename, ', '.join([self._recognize(alt) for alt in alternatives])) self.index = val['_M_index'] if self.index >= len(alternatives): self.contained_type = None @@ -1232,7 +1232,7 @@ class Printer(object): # Add a name using _GLIBCXX_BEGIN_NAMESPACE_CONTAINER. def add_container(self, base, name, function): self.add_version(base, name, function) - self.add_version(base + '__cxx1998::', name, function) + self.add_version(base, '__cxx1998::' + name, function) @staticmethod def get_basic_type(type): @@ -1511,7 +1511,7 @@ def build_libstdcxx_dictionary (): libstdcxx_printer.add_container('std::', 'bitset', StdBitsetPrinter) libstdcxx_printer.add_container('std::', 'deque', StdDequePrinter) libstdcxx_printer.add_container('std::', 'list', StdListPrinter) - libstdcxx_printer.add_container('std::__cxx11::', 'list', StdListPrinter) + libstdcxx_printer.add_container('std::', '__cxx11::list', StdListPrinter) libstdcxx_printer.add_container('std::', 'map', StdMapPrinter) libstdcxx_printer.add_container('std::', 'multimap', StdMapPrinter) libstdcxx_printer.add_container('std::', 'multiset', StdSetPrinter) @@ -1581,33 +1581,33 @@ def build_libstdcxx_dictionary (): StdForwardListPrinter) # Library Fundamentals TS components - libstdcxx_printer.add_version('std::experimental::fundamentals_v1::', - 'any', StdExpAnyPrinter) - libstdcxx_printer.add_version('std::experimental::fundamentals_v1::', - 'optional', StdExpOptionalPrinter) - libstdcxx_printer.add_version('std::experimental::fundamentals_v1::', - 'basic_string_view', StdExpStringViewPrinter) + libstdcxx_printer.add_version('std::', 'experimental::fundamentals_v1::any', + StdExpAnyPrinter) + libstdcxx_printer.add_version('std::', 'experimental::fundamentals_v1::optional', + StdExpOptionalPrinter) + libstdcxx_printer.add_version('std::', 'experimental::fundamentals_v1::basic_string_view', + StdExpStringViewPrinter) # Filesystem TS components - libstdcxx_printer.add_version('std::experimental::filesystem::v1::', - 'path', StdExpPathPrinter) - libstdcxx_printer.add_version('std::experimental::filesystem::v1::__cxx11::', - 'path', StdExpPathPrinter) - libstdcxx_printer.add_version('std::filesystem::', - 'path', StdExpPathPrinter) - libstdcxx_printer.add_version('std::filesystem::__cxx11::', - 'path', StdExpPathPrinter) + libstdcxx_printer.add_version('std::', 'experimental::filesystem::v1::path', + StdExpPathPrinter) + libstdcxx_printer.add_version('std::', 'experimental::filesystem::v1::__cxx11::path', + StdExpPathPrinter) + libstdcxx_printer.add_version('std::', 'filesystem::path', + StdExpPathPrinter) + libstdcxx_printer.add_version('std::', 'filesystem::__cxx11::path', + StdExpPathPrinter) # C++17 components - libstdcxx_printer.add_version('std::', - 'any', StdExpAnyPrinter) - libstdcxx_printer.add_version('std::', - 'optional', StdExpOptionalPrinter) - libstdcxx_printer.add_version('std::', - 'basic_string_view', StdExpStringViewPrinter) - libstdcxx_printer.add_version('std::', - 'variant', StdVariantPrinter) - libstdcxx_printer.add_version('std::', - '_Node_handle', StdNodeHandlePrinter) + libstdcxx_printer.add_version('std::', 'any', + StdExpAnyPrinter) + libstdcxx_printer.add_version('std::', 'optional', + StdExpOptionalPrinter) + libstdcxx_printer.add_version('std::', 'basic_string_view', + StdExpStringViewPrinter) + libstdcxx_printer.add_version('std::', 'variant', + StdVariantPrinter) + libstdcxx_printer.add_version('std::', '_Node_handle', + StdNodeHandlePrinter) # Extensions. libstdcxx_printer.add_version('__gnu_cxx::', 'slist', StdSlistPrinter) --------------900F0DB0B3B24026B891BCFC--