This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: nested class
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: gdb at sources dot redhat dot com, cronus at gmx dot at
- Date: Tue, 24 Aug 2004 06:38:56 -0400
- Subject: Re: nested class
- References: <200408241004.52754.cronus@gmx.at>
In your test program, there are no fields or data members
of type A:AA, so the compiler is likely to discard the
debug info for that type.
Change the test program to:
class A {
public:
int i;
} x;
int j;
};
int main () {
A::AA * p = new A::AA();
return p->i; // break here
}
Then in gdb:
(gdb) break main
(gdb) run
(gdb) next
(gdb) print ('A:AA' *) p
The second trick is to use single quotes around the name
of the nested type.
This works for me with gcc 3.3.4, gdb 6.1, dwarf-2.