From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109789 invoked by alias); 6 Mar 2018 21:21:24 -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 109765 invoked by uid 89); 6 Mar 2018 21:21:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-it0-f54.google.com Received: from mail-it0-f54.google.com (HELO mail-it0-f54.google.com) (209.85.214.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Mar 2018 21:21:22 +0000 Received: by mail-it0-f54.google.com with SMTP id w63so640570ita.3; Tue, 06 Mar 2018 13:21:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EaOla9uv9mw3dOb3i+3Sdg+DuxX5hgfFdjdGCxYEkyM=; b=CK6XcelTP6EwByGCaS0Ehu73G/mB/x/Fe9xNjrSf7BwRZvUgElEJbTABjSiMfooDR/ vk+m8k6dchgp+b1/FqckVtESkybqQDqrFGgMoTuV1kgqF5DeK6Ot6rhBr9/5jPzLcdhE rdMsSEF/BXtVZcqsSEsYNXiAMIZb5NmAcAzIq0y0T1xIgh6R/NXJfCZsg8zlhUpn+FPO kMv0SQk+CZBlsI2Bqzyk6bHdbzRIZbY3Q5QvDxUkkzZTEEwWZdXpMu6wSDo1RtmtkSr8 3lRdQAvjIdgxieG1AmpXbBj+5OIQV3cXF6TeLEpztqZWPmkpvYL1uwvgM35TB1kv6JLy LEpQ== X-Gm-Message-State: AElRT7FLUXlogmI3+VnUZfrMPtYALD5Jf56WhoNptdZAa4h1G0EaS6+y hUs6kTpLXrRux9lV+lOUwIPM6yOhw3NMr/eHmoY= X-Google-Smtp-Source: AG47ELv3ehcd0B6U4v/AmqjQ2Ve5CFIccMyQ3t3sfd5mdLsNZYAmeJAGRlqhNZGsBSytifRf9yK9e52qPAVJk+cfCm8= X-Received: by 10.36.0.130 with SMTP id 124mr19292952ita.91.1520371280947; Tue, 06 Mar 2018 13:21:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.50.83 with HTTP; Tue, 6 Mar 2018 13:21:20 -0800 (PST) In-Reply-To: <62558510-8551-9275-d4dd-94acbd8914e0@gmail.com> References: <62558510-8551-9275-d4dd-94acbd8914e0@gmail.com> From: Jonathan Wakely Date: Tue, 06 Mar 2018 21:21:00 -0000 Message-ID: Subject: Re: Fix some _GLIBCXX_DEBUG pretty printer errors To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-03/txt/msg00287.txt.bz2 On 5 February 2018 at 06:49, Fran=C3=A7ois Dumont wrote: > Hi > > Here is a patch to fix some pretty printer check errors when running > those tests with _GLIBCXX_DEBUG. > > I introduced a special rendered for the std::forward_list iterator wh= ich > is similar to the one used for the std::list and so used inheritance, I h= ope > it is not a problem for Python 2/3 compatibility. > > I prefer to just rely on normal iterator rendered when we detect that > iterator hasn't been initialized so that normal or debug modes give the s= ame > result. > > Ok to commit ? > > Fran=C3=A7ois > > >@@ -575,10 +586,12 @@ class StdDebugIteratorPrinter: > # and return the wrapped iterator value. > def to_string (self): > base_type =3D gdb.lookup_type('__gnu_debug::_Safe_iterator_base') >+ itype =3D self.val.type.template_argument(0) > safe_seq =3D self.val.cast(base_type)['_M_sequence'] >- if not safe_seq or self.val['_M_version'] !=3D safe_seq['_M_versi= on']: >+ if not safe_seq: >+ return str(self.val.cast(itype)) So what's the effect of this change when we get a value-initialized debug iterator? It prints the wrapped (value-initialized) non-debug iterator instead?