This is the mail archive of the gdb@sources.redhat.com 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: new testsuite function for c++ ptype


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


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