This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: new testsuite function for c++ ptype
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: cagney at gnu dot org
- Cc: gdb at sources dot redhat dot com, david dot carlton at sun dot com,carlton at bactrian dot org
- Date: Wed, 04 Aug 2004 00:35:39 -0400
- Subject: Re: new testsuite function for c++ ptype
- References: <410F9C94.nail8KU11N4AM@mindspring.com><410FE479.1020104@gnu.org>
Andrew Cagney <cagney@gnu.org> wrote:
ac> {
ac> { field private "int a;" }
ac> { method public "virtual int f();" }
ac> }
That's a great idea!
I like the flat 3-tuples a bit better than the more nested "field {
private "int a;" }" form. Then I can do:
{
{ vbptr private "A" }
{ field private "int a;" }
{ method public "virtual int f();" }
}
This is much more flexible for the future. And it cuts down on the
required backslashes, too.
ac> - I don't undersand why "V" appears twice in:
ac> > "class" "VA" { "public virtual V" } \
ac> > { "V" } \
ac> I guess I'm really asking if "V" can be extracted from "public virtual V"
Almost, but it won't actually work. The problem is indirect base classes:
cp_test_ptype_class "ptype pBe" "ptype pBe" \
"class" "B" { "public A" } \
{
{ vbptr private "V" }
{ field private "int a;" }
{ method public "virtual int f(); }
} \
*
I could say: all the direct virtual base classes are automatically
entered in the vbptr list, so the caller only has to list the
indirect virtual base classes. I'm dubious about that, because
it's more complicated than just "list all the vbptrs that pop up".
Michael C