This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: getting subclass type from base class pointer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]