From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10127 invoked by alias); 13 Apr 2011 15:27:06 -0000 Received: (qmail 10119 invoked by uid 22791); 13 Apr 2011 15:27:06 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.nokia.com (HELO mgw-da01.nokia.com) (147.243.128.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Apr 2011 15:26:58 +0000 Received: from gar.localnet (bettdhcp167187.europe.nokia.com [172.25.167.187]) by mgw-da01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p3DFQtgn013861 for ; Wed, 13 Apr 2011 18:26:56 +0300 From: =?utf-8?q?Andr=C3=A9_P=C3=B6nitz?= To: gdb@sourceware.org Subject: Re: cast in gdb python results in virtual baseclass botch Date: Wed, 13 Apr 2011 15:27:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.5; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104131726.55718.andre.poenitz@nokia.com> X-Nokia-AV: Clean 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/msg00048.txt.bz2 On Wednesday 13 April 2011 16:59:49 ext Christoph Mathys wrote: > I try to cast a gdb.Value to another type. There are cases where it > works, and others where it doesn't, and I don't really know why. If it > doesn't work, I get the following exception when I call cast(): > RuntimeError: virtual baseclass botch > > I use gdb 7.2, which apparently does not yet support dynamic_cast(). > > Both variables are stored inside a boost::shared_ptr, and I try to > cast to contained interface pointer to a specific implementation > pointer. I don't think you have to cast. inner = item.value["px"].dereference() has already the correct type. Andre'