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


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 *

Andre'


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