From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36346 invoked by alias); 16 Dec 2016 13:32:29 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 36213 invoked by uid 89); 16 Dec 2016 13:32:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=universal, policy X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Dec 2016 13:32:27 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D16A881236; Fri, 16 Dec 2016 13:32:25 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-204-40.brq.redhat.com [10.40.204.40]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBGDWL2v018557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 16 Dec 2016 08:32:24 -0500 Date: Fri, 16 Dec 2016 13:32:00 -0000 From: Jan Kratochvil To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, Keith Seitz , Pedro Alves , gdb@sourceware.org Subject: Re: [PATCH] PR59170 make pretty printers check for singular iterators Message-ID: <20161216133220.GA32613@host1.jankratochvil.net> References: <20161215141817.GA22699@redhat.com> <20161215211903.GA22897@host1.jankratochvil.net> <20161216010707.GF22266@redhat.com> <20161216075136.GA21305@host1.jankratochvil.net> <20161216123352.GB895@redhat.com> <20161216130645.GA27556@host1.jankratochvil.net> <20161216131732.GE895@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161216131732.GE895@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00027.txt.bz2 On Fri, 16 Dec 2016 14:17:32 +0100, Jonathan Wakely wrote: > On 16/12/16 14:06 +0100, Jan Kratochvil wrote: > > (gdb) p bb.c.d > > $4 = (D &) @0x601028: {e = 0x601060 } > > Wat? > > bb.c.d is not a valid expression. > > B::c is a pointer, it should be bb.c->d > > Is it GDB policy to make invalid expressions like that "work"? Yes, this is a GDB extension from the times of plain C. In C++ it became a problem. That was not the topic of this example for the initial dereferencing operator. > I had no idea this even worked, I'd have used bb.c->d.e->i because > that's the correct expression for accessing that variable. There was a plan to make the 'compile' project backward compatible with these confusing GDB universal dot operators. Jan