need help with fdump-class-hierarchy

R

Ripunjay Tripathi

In a g++ compiler "fdump-class-hierarchy" can be used to analyze the
dump of inheritance hierarchy.

My real aim is to study virtual table implementation, and memory
organization of virtual inheritance thing. However, I am NOT able to
read and understand the offsets and codes. Can anyone here please give
me a pointer where can I get material to study all this.

I also sincerely apologize if this is a wrong place for this query -


example dump is -

Class D
size=4 align=4
base size=4 base align=4
D (0xb6b8fe00) 0

Class A
size=4 align=4
base size=4 base align=4
A (0xb6b8fec0) 0

Class B
size=4 align=4
base size=4 base align=4
B (0xb6b8ff00) 0

Vtable for C
C::_ZTV1C: 3u entries
0 16u
4 (int (*)(...))0
8 (int (*)(...))(& _ZTI1C)

VTT for C
C::_ZTT1C: 1u entries
0 ((& C::_ZTV1C) + 12u)

Class C
size=20 align=4
base size=16 base align=4
C (0xb6b8ff40) 0
vptridx=0u vptr=((& C::_ZTV1C) + 12u)
B (0xb6b8ff80) 16 virtual
vbaseoffset=-0x00000000c
A (0xb6b8ffc0) 4

1) Whats 3u, 1u, 12u here ?
2) What is _ZTT1C ?
3) What is vptridx ? (v pointer index I guess)


Regards,
Ripunjay Tripathi
 
V

Vaclav Haisman

Ripunjay Tripathi wrote, On 16.12.2008 8:11:
In a g++ compiler "fdump-class-hierarchy" can be used to analyze the
dump of inheritance hierarchy.

My real aim is to study virtual table implementation, and memory
organization of virtual inheritance thing. However, I am NOT able to
read and understand the offsets and codes. Can anyone here please give
me a pointer where can I get material to study all this.

I also sincerely apologize if this is a wrong place for this query -


example dump is -

Class D
size=4 align=4
base size=4 base align=4
D (0xb6b8fe00) 0

Class A
size=4 align=4
base size=4 base align=4
A (0xb6b8fec0) 0

Class B
size=4 align=4
base size=4 base align=4
B (0xb6b8ff00) 0

Vtable for C
C::_ZTV1C: 3u entries
0 16u
4 (int (*)(...))0
8 (int (*)(...))(& _ZTI1C)

VTT for C
C::_ZTT1C: 1u entries
0 ((& C::_ZTV1C) + 12u)

Class C
size=20 align=4
base size=16 base align=4
C (0xb6b8ff40) 0
vptridx=0u vptr=((& C::_ZTV1C) + 12u)
B (0xb6b8ff80) 16 virtual
vbaseoffset=-0x00000000c
A (0xb6b8ffc0) 4

1) Whats 3u, 1u, 12u here ?
Unsigned integer values. 3, 1 and 12.
2) What is _ZTT1C ?
shell::wilx:~> c++filt _ZTT1C
VTT for C

For more details you will have to read either the GCC internals documentation
or directly its code.
3) What is vptridx ? (v pointer index I guess)
I guess it has something to do with possible multiple virtual methods tables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top