mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:24:52 +08:00
[0.2.x] refactored : typeInfo class
git-svn-id: https://pykd.svn.codeplex.com/svn@78580 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
98ff37bb29
commit
91e158ea6a
@ -78,9 +78,28 @@ ULONG64 TypeInfo::getSymbolSize( const std::string &fullName )
|
|||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &typeSym )
|
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &typeSym )
|
||||||
{
|
{
|
||||||
const ULONG symTag = typeSym->getSymTag();
|
ULONG symTag = typeSym->getSymTag();
|
||||||
|
|
||||||
switch( symTag )
|
switch( symTag )
|
||||||
{
|
{
|
||||||
|
case SymTagData:
|
||||||
|
|
||||||
|
if ( typeSym->getLocType() == LocIsBitField )
|
||||||
|
{
|
||||||
|
return TypeInfoPtr( new BitFieldTypeInfo(typeSym) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( typeSym->getDataKind() == DataIsConstant )
|
||||||
|
{
|
||||||
|
BaseTypeVariant constVal;
|
||||||
|
typeSym->getValue( constVal );
|
||||||
|
TypeInfoPtr ptr = getTypeInfo( typeSym->getType() );
|
||||||
|
ptr->setConstant( constVal );
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getTypeInfo( typeSym->getType() );
|
||||||
|
|
||||||
case SymTagBaseType:
|
case SymTagBaseType:
|
||||||
return getBaseTypeInfo( typeSym );
|
return getBaseTypeInfo( typeSym );
|
||||||
|
|
||||||
@ -129,17 +148,7 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, const std::string &symN
|
|||||||
if ( basePtr != 0 )
|
if ( basePtr != 0 )
|
||||||
return basePtr;
|
return basePtr;
|
||||||
|
|
||||||
return getTypeInfo( symScope, symScope->getChildByName( symName ) );
|
SymbolPtr symType = symScope->getChildByName( symName );
|
||||||
}
|
|
||||||
|
|
||||||
return getComplexType( symScope, symName );
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild )
|
|
||||||
{
|
|
||||||
SymbolPtr symType = symChild;
|
|
||||||
|
|
||||||
if ( symType->getSymTag() == SymTagData )
|
if ( symType->getSymTag() == SymTagData )
|
||||||
{
|
{
|
||||||
@ -161,6 +170,9 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild )
|
|||||||
}
|
}
|
||||||
|
|
||||||
return getTypeInfo( symType );
|
return getTypeInfo( symType );
|
||||||
|
}
|
||||||
|
|
||||||
|
return getComplexType( symScope, symName );
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -558,7 +570,7 @@ void UdtTypeInfo::getFields(
|
|||||||
else
|
else
|
||||||
if ( symTag == SymTagData )
|
if ( symTag == SymTagData )
|
||||||
{
|
{
|
||||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( rootSym, childSym );
|
TypeInfoPtr ti = TypeInfo::getTypeInfo( childSym );
|
||||||
|
|
||||||
ULONG fieldOffset = 0;
|
ULONG fieldOffset = 0;
|
||||||
switch ( childSym->getDataKind() )
|
switch ( childSym->getDataKind() )
|
||||||
@ -587,7 +599,7 @@ void UdtTypeInfo::getFields(
|
|||||||
else
|
else
|
||||||
if ( symTag == SymTagVTable )
|
if ( symTag == SymTagVTable )
|
||||||
{
|
{
|
||||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( rootSym, childSym );
|
TypeInfoPtr ti = TypeInfo::getTypeInfo( childSym );
|
||||||
|
|
||||||
if ( baseVirtualSym )
|
if ( baseVirtualSym )
|
||||||
{
|
{
|
||||||
|
@ -31,9 +31,6 @@ public:
|
|||||||
static
|
static
|
||||||
TypeInfoPtr getTypeInfo( SymbolPtr &symScope, const std::string &symName );
|
TypeInfoPtr getTypeInfo( SymbolPtr &symScope, const std::string &symName );
|
||||||
|
|
||||||
static
|
|
||||||
TypeInfoPtr getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild );
|
|
||||||
|
|
||||||
static
|
static
|
||||||
TypeInfoPtr getTypeInfo( SymbolPtr &symbol );
|
TypeInfoPtr getTypeInfo( SymbolPtr &symbol );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user