'Understanding names of classes in output of `-dump-lang-class`
I have the following code
class Base
{
public:
int bi;
};
class Parent1 : public Base {
public:
int p1i;
long p1l;
void f(){};
void f3(){};
};
class Parent2 : public Base {
public:
long p2i;
int p2l;
void f(){};
void f3(){};
};
I dump the class hierarchy using g++ -fdump-lang-class -g main.cpp and I get the following
Class Base
size=4 align=4
base size=4 base align=4
Base (0x0x7f65e57a9420) 0
Class Parent1
size=16 align=8
base size=16 base align=8
Parent1 (0x0x7f65e564a340) 0
Base (0x0x7f65e57a9480) 0
Class Parent2
size=24 align=8
base size=20 base align=8
Parent2 (0x0x7f65e564a3a8) 0
Base (0x0x7f65e57a95a0) 0
I understand the size and align values for the class and the base entries. But I am trying to wrap my head around the hexadecimal values at the end of each class.
Here are my questions:
- It starts with double
0x, so I am not sure if this truly hexadecimal numbers or not. - Are they memory addresses for constructors? if yes, why there are two copies of the same constructor ?
- The order of names to the left of them are the order of constructor hierarchy.
- What are the zeros to the right of them ?
N.B: I know that stack-over-flow has similar questions, but they explain the size and align values only. None explains the other part.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
