From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53747 invoked by alias); 30 Oct 2015 11:26:21 -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 53720 invoked by uid 89); 30 Oct 2015 11:26:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-by2-obe.outbound.protection.outlook.com Received: from mail-by2on0060.outbound.protection.outlook.com (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.100.60) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Fri, 30 Oct 2015 11:26:18 +0000 Received: from CY1PR0501MB1178.namprd05.prod.outlook.com (10.160.145.14) by CY1PR0501MB1178.namprd05.prod.outlook.com (10.160.145.14) with Microsoft SMTP Server (TLS) id 15.1.306.13; Fri, 30 Oct 2015 11:26:14 +0000 Received: from CY1PR0501MB1178.namprd05.prod.outlook.com ([10.160.145.14]) by CY1PR0501MB1178.namprd05.prod.outlook.com ([10.160.145.14]) with mapi id 15.01.0306.003; Fri, 30 Oct 2015 11:26:14 +0000 From: Paul Marquess To: =?iso-8859-1?Q?Andr=E9_P=F6nitz?= CC: "gdb@sourceware.org" Subject: RE: getting subclass type from base class pointer Date: Fri, 30 Oct 2015 11:26:00 -0000 Message-ID: References: <20151030072010.GA12621@klara.mpi.htwm.de> In-Reply-To: <20151030072010.GA12621@klara.mpi.htwm.de> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Paul.Marquess@owmobility.com; x-microsoft-exchange-diagnostics: 1;CY1PR0501MB1178;5:CpulhYHarwDpa7ICliGjICCrXxs93op1tzfI3+5UKICP4lxcx+c7kKvcW8OO/v+d3zk7cqnWSztJ+5zJQfaeKg0EbBs1eAnu6e0RaaydlksmepStz0ofeHO6TohSdhxoZI+7tSf92uCwSqiv/0YsmQ==;24:Ni/S5+4JE18oYVJ9FGIgWl3cmloq7vIl6ywn67/hIYJeqiYZYl3h1gqUutz+QCkYrjsydcc5h9dZYbRDW4wFMMaGI0whbEpNYK5M7NLIHds=;20:PE4nJ03QAP6bz087M54ON1uyFR26bmySJ+X+2wR+YR04pXquk/arg29Fe0RKtltiDW4GLi78WO9fYusEZoqBSw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1178; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(184342363174585); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046)(102215026);SRVR:CY1PR0501MB1178;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1178; x-forefront-prvs: 07459438AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(199003)(189002)(51914003)(5001960100002)(77096005)(76176999)(105586002)(5007970100001)(2950100001)(54356999)(122556002)(86362001)(102836002)(5003600100002)(50986999)(106356001)(74316001)(110136002)(11100500001)(5008740100001)(5004730100002)(40100003)(99286002)(189998001)(5001920100001)(66066001)(97736004)(87936001)(5002640100001)(33656002)(81156007)(92566002)(101416001)(2900100001)(19580395003)(10400500002)(76576001)(19580405001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0501MB1178;H:CY1PR0501MB1178.namprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: owmobility.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: owmobility.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2015 11:26:14.2097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 042bf9d6-5c89-4240-a963-35f806e16660 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1178 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00115.txt.bz2 From: Andr=E9 P=F6nitz [mailto:apoenitz@t-online.de]=20 =20 > On Thu, Oct 29, 2015 at 11:38:27PM +0000, Paul Marquess wrote: > > > gdb) python x =3D gdb.parse_and_eval("pTest") > > > (gdb) python print x.type > > > SuperClass * >=20 > (gdb) python print(x.type) > SuperClass * > (gdb) python print(x.dynamic_type) > SubClass * Bingo! That did it. Hmm, could have sworn that I tried that myself (but obviously I'm deluding = myself). Thanks for the help Paul