This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: layout of the g++ virtual tables
- To: comar at act-europe dot fr
- Subject: Re: layout of the g++ virtual tables
- From: mrs at wrs dot com (Mike Stump)
- Date: Wed, 5 Aug 1998 13:26:16 -0700
- Cc: egcs at cygnus dot com
> Date: Wed, 5 Aug 1998 11:07:55 +0200
> From: Cyrille Comar <comar@act-europe.fr>
> I was wondering if there was some type specific information stored
> along with the virtual table.
Yes. RTTI (if compiled with -frtti (which is the default)) is
included in all objects that have at least one vtable pointer. There
you can get at things like the ``name'' of the class, the type
involved, base classes and the like.
In this case, I'll point you at the code. See tinfo*.cc in the
compiler.
> In GNAT we store plenty of other information used among other thing
> to check the validity of the downcasts
This can be done.
> Wouldn't the first 2 words be used for something like that by any
> chance?
Yes.