[0.1.x] fixed : issue #10628 ( typedef is not supported )

git-svn-id: https://pykd.svn.codeplex.com/svn@75424 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2012-04-10 16:48:51 +00:00 committed by Mikhail I. Izmestev
parent f626309edb
commit e66c64ea54
3 changed files with 13 additions and 0 deletions

View File

@ -36,6 +36,9 @@ TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &typeSym )
case SymTagEnum:
return TypeInfoPtr( new EnumTypeInfo( typeSym ) );
case SymTagTypedef:
return getTypeInfo( typeSym->getType() );
}
throw TypeException( typeSym->getName(), "this type is not supported" );

View File

@ -175,3 +175,7 @@ class TypeInfoTest( unittest.TestCase ):
self.assertTrue( str(target.module.type( "g_arrOfPtrToFunc" ) ) )
self.assertTrue( str(target.module.type( "g_unTypedPtrToFunction" ) ) )
def testTypedef(self):
self.assertEqual( "structTest", pykd.typeInfo( "g_structTypeDef" ).name() )
self.assertEqual( "structTest", pykd.typeInfo( "structTestTypeDef" ).name() )

View File

@ -240,6 +240,10 @@ WNDENUMPROC g_ptrToFunction;
void *g_unTypedPtrToFunction = g_ptrToFunction;
#pragma pack( pop )
typedef struct structTest structTestTypeDef;
structTestTypeDef g_structTypeDef = { 0 };
////////////////////////////////////////////////////////////////////////////////
#define InitializeListHead(ListHead) (\
@ -304,6 +308,8 @@ void FuncWithName0()
std::cout << g_unNamedStruct.m_fieldNestedStruct;
std::cout << g_structNested.m_nestedFiled;
std::cout << g_unTypedPtrToFunction;
std::cout << g_structTypeDef.m_field0;
}
////////////////////////////////////////////////////////////////////////////////