C++?麯???????
???????????? ???????[ 2015/8/6 14:34:11 ] ????????.NET ???????????
???????
????class CDerived2: virtual public CBase
????{
????public:
????void fun(void) { }
????virtual void vfun(void) { }
????public:
????int m_derived;
????};
????????????
class CDerived2 size(20):
+---
0 | {vfptr}
4 | {vbptr}
8 | m_derived
+---
+--- (virtual base CBase)
12 | {vfptr}
16 | m_valuable
+---
CDerived2::$vftable@CDerived2@:
| &CDerived2_meta
| 0
0 | &CDerived2::vfun
CDerived2::$vbtable@:
0 | -4
1 | 8 (CDerived2d(CDerived2+4)CBase)
CDerived2::$vftable@CBase@:
| -12
0 | &CDerived2::fun
CDerived2::fun this adjustor: 12
CDerived2::vfun this adjustor: 0
vbi: class offset o.vbptr o.vbte fVtorDisp
CBase 12 4 4 0
????????vftable@????????????CDerived2::vfun()??vbtable@??????????????virtual??е????CBase????vftable@CBase?????CBase::fun?????CDerived2::fun??
????CDerived3??virtual???CBase???????vbtable@?????member@?????CBase??
????class CDerived3: virtual public CBase
????{
????public:
????void fun(void) { }
????public:
????int m_derived3;
????};
????????????
class CDerived3 size(16):
+---
0 | {vbptr}
4 | m_derived3
+---
+--- (virtual base CBase)
8 | {vfptr}
12 | m_valuable
+---
CDerived3::$vbtable@:
0 | 0
1 | 8 (CDerived3d(CDerived3+0)CBase)
CDerived3::$vftable@:
| -8
0 | &CDerived3::fun
CDerived3::fun this adjustor: 8
vbi: class offset o.vbptr o.vbte fVtorDisp
CBase 8 0 4 0
CGDerived?????CDerived2??CDerived3
class CGDerived: public CDerived2?? public CDerived3
{
public:
void vfun() { }
virtual void vgfun() { }
public:
int m_gd;
};
?????????
class CGDerived size(32):
+---
| +--- (base class CDerived2)
0 | | {vfptr}
4 | | {vbptr}
8 | | m_derived
| +---
| +--- (base class CDerived3)
12 | | {vbptr}
16 | | m_derived3
| +---
20 | m_gd
+---
+--- (virtual base CBase)
24 | {vfptr}
28 | m_valuable
+---
CGDerived::$vftable@CDerived2@:
| &CGDerived_meta
| 0
0 | &CGDerived::vfun
1 | &CGDerived::vgfun
CGDerived::$vbtable@CDerived2@:
0 | -4
1 | 20 (CGDerivedd(CDerived2+4)CBase)
CGDerived::$vbtable@CDerived3@:
0 | 0
1 | 12 (CGDerivedd(CDerived3+0)CBase)
CGDerived::$vftable@CBase@:
| -24
0 | &thunk: this-=12; goto CDerived2::fun
CGDerived::vfun this adjustor: 0
CGDerived::vgfun this adjustor: 0
vbi: class offset o.vbptr o.vbte fVtorDisp
CBase 24 4 4 0
?????????????CDerived2?????CDerived3????????????virtual????vgfun???????????CDerived2???麯?????С???????????????
??????CDerived2??CDerived3?????CBase????????С?
????????fun??????CGDerived??????CDerived2::fun??
????CGG?????CGDerived
????class CGG: public CGDerived
????{
????public:
????int m_kc;
????};
?????????
class CGG size(36):
+---
| +--- (base class CGDerived)
| | +--- (base class CDerived2)
0 | | | {vfptr}
4 | | | {vbptr}
8 | | | m_derived
| | +---
| | +--- (base class CDerived3)
12 | | | {vbptr}
16 | | | m_derived3
| | +---
20 | | m_gd
| +---
24 | m_kc
+---
+--- (virtual base CBase)
28 | {vfptr}
32 | m_valuable
+---
CGG::$vftable@CDerived2@:
| &CGG_meta
| 0
0 | &CGDerived::vfun
1 | &CGDerived::vgfun
CGG::$vbtable@CDerived2@:
0 | -4
1 | 24 (CGGd(CDerived2+4)CBase)
CGG::$vbtable@CDerived3@:
0 | 0
1 | 16 (CGGd(CDerived3+0)CBase)
CGG::$vftable@CBase@:
| -28
0 | &thunk: this-=16; goto CDerived2::fun
vbi: class offset o.vbptr o.vbte fVtorDisp
CBase 28 4 4 0
???????????????????????????CGDerived????????????????????????????
????vbtable?????????????????
????????
????class CBase2
????{
????};
?????????
????class CBase2 size(1):
????+---
????+---
????CD2??virtual????????????vbtable????vbptr?????????size?4
????class CD2: virtual public CBase2
????{
????};
?????????
????class CD2 size(4):
????+---
????0 | {vbptr}
????+---
????+--- (virtual base CBase2)
????+---
????CD2::$vbtable@:
????0 | 0
????1 | 4 (CD2d(CD2+0)CBase2)
????vbi: class offset o.vbptr o.vbte fVtorDisp
????CBase2 4 0 4 0
????CE????virtual???CD2??CDerived2?????????????????????????CDerived2??????????CD2??????????????????
????class CE: public CD2?? public CDerived2
????{
????};
?????????
class CE size(24):
+---
| +--- (base class CDerived2)
0 | | {vfptr}
4 | | {vbptr}
8 | | m_derived
| +---
| +--- (base class CD2)
12 | | {vbptr}
| +---
+---
+--- (virtual base CBase2)
+---
+--- (virtual base CBase)
16 | {vfptr}
20 | m_valuable
+---
CE::$vftable@CDerived2@:
| &CE_meta
| 0
0 | &CDerived2::vfun
CE::$vbtable@CD2@:
0 | 0
1 | 4 (CEd(CD2+0)CBase2)
2 | 4 (CEd(CE+12)CBase)
CE::$vbtable@CDerived2@:
0 | -4
1 | 12 (CEd(CDerived2+4)CBase)
CE::$vftable@CBase@:
| -16
0 | &thunk: this-=4; goto CDerived2::fun
vbi: class offset o.vbptr o.vbte fVtorDisp
CBase2 16 12 4 0
CBase 16 12 8 0
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????