This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Getting to the source for a given C++ object
- From: Jason Molenda <jmolenda at apple dot com>
- To: Alex Bennee <kernel-hacker at bennee dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 10 Aug 2005 13:35:28 -0700
- Subject: Re: Getting to the source for a given C++ object
- References: <1123694226.6601.12.camel@okra.transitives.com>
On Aug 10, 2005, at 10:17 AM, Alex Bennee wrote:
I'm currently trying to debug a C++ program that makes heavy use of
templates and derived classes. Is there an easy way to get to the
actual
code for a given class pointer?
I'm not sure exactly what you're looking for. ptype can tell you
the class - is that what you want? e.g.
(gdb) p beta
$1 = {<A> = {_vptr$A = 0x30b0, a1 = 200}, b1 = 201, b2 = 202}
(gdb) ptype beta
type = class B : public A {
public:
int b1;
int b2;
B(B const&);
B(B const&);
B();
B();
~B();
virtual ~B();
virtual ~B();
}
(gdb)
J