From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42383 invoked by alias); 29 Oct 2015 19:41:04 -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 42233 invoked by uid 89); 29 Oct 2015 19:41:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 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-bl2-obe.outbound.protection.outlook.com Received: from mail-bl2on0057.outbound.protection.outlook.com (HELO na01-bl2-obe.outbound.protection.outlook.com) (65.55.169.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Thu, 29 Oct 2015 19:41:01 +0000 Received: from CY1PR0501MB1178.namprd05.prod.outlook.com (10.160.145.14) by CY1PR0501MB1179.namprd05.prod.outlook.com (10.160.145.140) with Microsoft SMTP Server (TLS) id 15.1.306.13; Thu, 29 Oct 2015 19:40:57 +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; Thu, 29 Oct 2015 19:40:57 +0000 From: Paul Marquess To: "gdb@sourceware.org" Subject: getting subclass type from base class pointer Date: Thu, 29 Oct 2015 19:41:00 -0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Paul.Marquess@owmobility.com; x-microsoft-exchange-diagnostics: 1;CY1PR0501MB1179;5:ne/8BLeKYZTPNQTK3GmmXU38bo/7+AzmfBxoppLV79pUrifjONOJP+ySVZeoYPfzWDbTboEUWv4g3g72nCUOREckyJX7lzM7d+RLY0H5HCvoUdBqBTwIwofncO8J9qrZ/re0Mqgk7kgjRnPi+RYR7w==;24:MNFYsjCxhhS3AUBftVlvFnCWEAVQQQCls5fYHm3/F085z2mZ9f6kYEGUYC8VYBXyhYI6ZTAXzMTwP9SQziM7cKDbpeeGzJ60JjR+/ikVnlM=;20:NQIL5VLe77kF36xGAOjVfxuK4/GMsfnxiyROyy53bQapwc7G7O+LvCYSMqtrIgynoP9v2KAxGNdbOQ0vSLQR1w== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1179; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046)(102215026);SRVR:CY1PR0501MB1179;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1179; x-forefront-prvs: 0744CFB5E8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(189002)(199003)(101416001)(5004730100002)(2501003)(92566002)(50986999)(102836002)(450100001)(122556002)(87936001)(66066001)(2900100001)(81156007)(54356999)(11100500001)(76576001)(10400500002)(97736004)(5007970100001)(5008740100001)(110136002)(5003600100002)(74316001)(99286002)(40100003)(229853001)(106356001)(2351001)(86362001)(189998001)(5001960100002)(5002640100001)(107886002)(33656002)(77096005)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0501MB1179;H:CY1PR0501MB1178.namprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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: 29 Oct 2015 19:40:57.7638 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 042bf9d6-5c89-4240-a963-35f806e16660 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1179 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00111.txt.bz2 I must be missing something obvious, so apologies upfront. Consider this simple snippet of C++ class SuperClass=20 { }; class SubClass : public SuperClass=20 { }; int main() { =A0=A0=A0 SuperClass* pTest =3D new SubClass; =A0=A0=A0 delete pTest; // << Break here in GDB } Using the python API I'm trying to determine the type of object that pTest = points to.=20 gdb) python x =3D gdb.parse_and_eval("pTest") (gdb) python print x.type SuperClass * (gdb) python print x.dereference().type SuperClass How do I get at the SubClass object using the Python API? cheers Paul PS running GDB 7.10 $ gdb -v GNU gdb (GDB) 7.10