mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +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 )
|
||||
{
|
||||
const ULONG symTag = typeSym->getSymTag();
|
||||
ULONG symTag = typeSym->getSymTag();
|
||||
|
||||
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:
|
||||
return getBaseTypeInfo( typeSym );
|
||||
|
||||
@ -129,17 +148,7 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, const std::string &symN
|
||||
if ( basePtr != 0 )
|
||||
return basePtr;
|
||||
|
||||
return getTypeInfo( symScope, symScope->getChildByName( symName ) );
|
||||
}
|
||||
|
||||
return getComplexType( symScope, symName );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild )
|
||||
{
|
||||
SymbolPtr symType = symChild;
|
||||
SymbolPtr symType = symScope->getChildByName( symName );
|
||||
|
||||
if ( symType->getSymTag() == SymTagData )
|
||||
{
|
||||
@ -161,6 +170,9 @@ TypeInfoPtr TypeInfo::getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild )
|
||||
}
|
||||
|
||||
return getTypeInfo( symType );
|
||||
}
|
||||
|
||||
return getComplexType( symScope, symName );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -558,7 +570,7 @@ void UdtTypeInfo::getFields(
|
||||
else
|
||||
if ( symTag == SymTagData )
|
||||
{
|
||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( rootSym, childSym );
|
||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( childSym );
|
||||
|
||||
ULONG fieldOffset = 0;
|
||||
switch ( childSym->getDataKind() )
|
||||
@ -587,7 +599,7 @@ void UdtTypeInfo::getFields(
|
||||
else
|
||||
if ( symTag == SymTagVTable )
|
||||
{
|
||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( rootSym, childSym );
|
||||
TypeInfoPtr ti = TypeInfo::getTypeInfo( childSym );
|
||||
|
||||
if ( baseVirtualSym )
|
||||
{
|
||||
|
@ -31,9 +31,6 @@ public:
|
||||
static
|
||||
TypeInfoPtr getTypeInfo( SymbolPtr &symScope, const std::string &symName );
|
||||
|
||||
static
|
||||
TypeInfoPtr getTypeInfo( SymbolPtr &symScope, SymbolPtr &symChild );
|
||||
|
||||
static
|
||||
TypeInfoPtr getTypeInfo( SymbolPtr &symbol );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user