From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26143 invoked by alias); 13 Apr 2011 17:08:26 -0000 Received: (qmail 26133 invoked by uid 22791); 13 Apr 2011 17:08:24 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Apr 2011 17:08:18 +0000 Received: by qwa26 with SMTP id 26so648006qwa.0 for ; Wed, 13 Apr 2011 10:08:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.18.76 with SMTP id v12mr1555558qaa.75.1302714497854; Wed, 13 Apr 2011 10:08:17 -0700 (PDT) Received: by 10.229.83.194 with HTTP; Wed, 13 Apr 2011 10:08:17 -0700 (PDT) In-Reply-To: <201104131726.55718.andre.poenitz@nokia.com> References: <201104131726.55718.andre.poenitz@nokia.com> Date: Wed, 13 Apr 2011 17:08:00 -0000 Message-ID: Subject: Re: cast in gdb python results in virtual baseclass botch From: Christoph Mathys To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00049.txt.bz2 On Wed, Apr 13, 2011 at 5:26 PM, Andr=C3=A9 P=C3=B6nitz wrote: > I don't think you have to cast. > > inner =3D item.value["px"].dereference() =C2=A0 has already the correct t= ype. I expressed myself badly: class XmlNodeInterface { }; class XmlNode : public XmlNodeInterface { xmlNode* m_pNode; }; I've got a reference to a "shared_ptr", and I want m_pNode. So after I extracted px, I think I have to downcast from IXmlNode to XmlNode. Christoph