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
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