mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 11:53:23 +08:00
[0.1.x] fixed : issue #10921 ( typeInfo does not work with Base types )
git-svn-id: https://pykd.svn.codeplex.com/svn@78149 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
1c20123492
commit
592c241a1d
@ -502,6 +502,9 @@ ULONG64 DebugClient::getSymbolSize( const std::string &fullName )
|
||||
std::string moduleName;
|
||||
std::string symName;
|
||||
|
||||
if ( TypeInfo::isBaseType( fullName ) )
|
||||
return TypeInfo::getBaseTypeInfo( fullName )->getSize();
|
||||
|
||||
splitSymName( fullName, moduleName, symName );
|
||||
|
||||
ModulePtr module = loadModuleByName( moduleName );
|
||||
@ -521,6 +524,9 @@ TypeInfoPtr DebugClient::getTypeInfoByName( const std::string &typeName )
|
||||
std::string moduleName;
|
||||
std::string symName;
|
||||
|
||||
if ( TypeInfo::isBaseType( typeName ) )
|
||||
return TypeInfo::getBaseTypeInfo( typeName );
|
||||
|
||||
splitSymName( typeName, moduleName, symName );
|
||||
|
||||
ModulePtr module = loadModuleByName( moduleName );
|
||||
|
@ -136,6 +136,14 @@ TypeInfoPtr TypeInfo::getTypeInfo( pyDia::SymbolPtr &symScope, pyDia::SymbolPtr
|
||||
|
||||
static const boost::regex baseMatch("^(Char)|(WChar)|(Int1B)|(UInt1B)|(Int2B)|(UInt2B)|(Int4B)|(UInt4B)|(Int8B)|(UInt8B)|(Long)|(ULong)|(Float)|(Bool)|(Double)$" );
|
||||
|
||||
bool
|
||||
TypeInfo::isBaseType( const std::string &symName )
|
||||
{
|
||||
boost::cmatch baseMatchResult;
|
||||
|
||||
return boost::regex_match( symName.c_str(), baseMatchResult, baseMatch );
|
||||
}
|
||||
|
||||
TypeInfoPtr
|
||||
TypeInfo::getBaseTypeInfo( const std::string &symName )
|
||||
{
|
||||
|
@ -36,6 +36,9 @@ public:
|
||||
static
|
||||
TypeInfoPtr getBaseTypeInfo( pyDia::SymbolPtr &symbol );
|
||||
|
||||
static
|
||||
bool isBaseType( const std::string &name );
|
||||
|
||||
public:
|
||||
|
||||
TypeInfo() :
|
||||
|
@ -13,7 +13,7 @@ class TypeInfoTest( unittest.TestCase ):
|
||||
self.assertEqual( "structTest", pykd.typeInfo( target.moduleName + "!structTest" ).name() )
|
||||
self.assertEqual( "structTest", pykd.typeInfo( "g_structTest" ).name() )
|
||||
self.assertEqual( "structTest", pykd.typeInfo( target.moduleName + "!g_structTest" ).name() )
|
||||
self.assertEqual( "Int1B", pykd.typeInfo( "Int1B" ) )
|
||||
self.assertEqual( "Int1B", pykd.typeInfo( "Int1B" ).name() )
|
||||
|
||||
def testCreateByName( self ):
|
||||
""" creating typeInfo by the type name """
|
||||
|
Loading…
Reference in New Issue
Block a user