Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Marquess <Paul.Marquess@owmobility.com>
To: "André Pönitz" <apoenitz@t-online.de>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: getting subclass type from base class pointer
Date: Fri, 30 Oct 2015 11:26:00 -0000	[thread overview]
Message-ID: <CY1PR0501MB1178E91C5866A870CEC3854F952F0@CY1PR0501MB1178.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20151030072010.GA12621@klara.mpi.htwm.de>

From: André Pönitz [mailto:apoenitz@t-online.de] 
 
> On Thu, Oct 29, 2015 at 11:38:27PM +0000, Paul Marquess wrote:
> > > gdb) python x = gdb.parse_and_eval("pTest")
> > > (gdb) python print x.type
> > > SuperClass *
> 
> (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


      reply	other threads:[~2015-10-30 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 19:41 Paul Marquess
2015-10-29 23:38 ` Paul Marquess
2015-10-30  7:20   ` André Pönitz
2015-10-30 11:26     ` Paul Marquess [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY1PR0501MB1178E91C5866A870CEC3854F952F0@CY1PR0501MB1178.namprd05.prod.outlook.com \
    --to=paul.marquess@owmobility.com \
    --cc=apoenitz@t-online.de \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox