vtable origin in class information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear GCC supporters,

I would like to ask a question regarding the vtable information a
class has during compilation.

Assume that we have the following classes:
------------------------------------------
class A {
public:
virtual int virtFuncA(){ return 0xA; }
};

class B {
public:
virtual int virtFuncB(){ return 0xB; }
};

class C: public A, public B{
public:
int virtFuncA(){ return 0xCA; }
int virtFuncB(){ return 0xCB; }
virtual int virtFuncC(){ return 0xC; }
};

class D{
public:
virtual int virtFuncD(){ return 0xD; }
};

class E: public C, public D{
public:
int virtFuncA(){ return 0xEA; }
int virtFuncB(){ return 0xEB; }
int virtFuncC(){ return 0xEC; }
int virtFuncD(){ return 0xED; }
};
------------------------------------------

In the end class E will have three vtables. First two originate from
class C and third one originate from class D.
During compilation when we have the tree object of class E, could we
tell that its first two vtables originate from class C and third one
from class D?

Class C will have two vtables. The first one is a vtable originating
from class A merged with the vtable of class C itself, and the second
one is a vtable originating from class B.
During compilation, could we tell that the first vtable originates
from both class A and C itself?

If this is possible, could you please tell with which functions of gcc
this can be done?

I really appreciate any help you can provide.

Best, Enes



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux