mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 11:53:23 +08:00
[0.1.x] +additional test for wi:10763
git-svn-id: https://pykd.svn.codeplex.com/svn@76358 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
45f2b4c3ea
commit
64197229cd
@ -235,8 +235,13 @@ class TypedVarTest( unittest.TestCase ):
|
|||||||
self.assertTrue( str(target.module.typedVar( "g_voidPtr" ) ) )
|
self.assertTrue( str(target.module.typedVar( "g_voidPtr" ) ) )
|
||||||
self.assertTrue( str(target.module.typedVar( "g_arrOfPtrToFunc" ) ) )
|
self.assertTrue( str(target.module.typedVar( "g_arrOfPtrToFunc" ) ) )
|
||||||
self.assertTrue( str(target.module.typedVar( "g_unTypedPtrToFunction" ) ) )
|
self.assertTrue( str(target.module.typedVar( "g_unTypedPtrToFunction" ) ) )
|
||||||
|
|
||||||
def testStaticField(self):
|
def testStaticField(self):
|
||||||
ti = pykd.typedVar( "g_classChild" )
|
ti = pykd.typedVar( "g_classChild" )
|
||||||
self.assertEqual( 200, ti.m_staticField )
|
self.assertEqual( 200, ti.m_staticField )
|
||||||
self.assertEqual( 100, ti.m_staticConst )
|
self.assertEqual( 100, ti.m_staticConst )
|
||||||
|
|
||||||
|
def testAmbiguousFieldAccess(self):
|
||||||
|
derivedFiledVal = pykd.loadCStr( pykd.typedVar( "g_fieldSameNameStruct" ).m_field )
|
||||||
|
self.assertEqual( derivedFiledVal, "toaster" )
|
||||||
|
print target.module.type("fieldSameNameStruct")
|
||||||
|
@ -262,6 +262,57 @@ struct StructWithNested {
|
|||||||
StructWithNested g_structWithNested;
|
StructWithNested g_structWithNested;
|
||||||
StructWithNested::Nested g_structNested;
|
StructWithNested::Nested g_structNested;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
struct baseStruct1
|
||||||
|
{
|
||||||
|
int m_field;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct intermediateStruct : baseStruct1
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
struct baseStruct2
|
||||||
|
{
|
||||||
|
char m_field;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fieldSameNameStruct : intermediateStruct
|
||||||
|
, baseStruct2
|
||||||
|
{
|
||||||
|
char *m_field;
|
||||||
|
};
|
||||||
|
fieldSameNameStruct g_fieldSameNameStruct;
|
||||||
|
|
||||||
|
// kd> ?? g_fieldSameNameStruct
|
||||||
|
// struct fieldSameNameStruct
|
||||||
|
// +0x000 m_field : 0x400
|
||||||
|
// +0x004 m_field : 12 ''
|
||||||
|
// +0x008 m_field : 0x00000001`3f7bc928 "toaster"
|
||||||
|
|
||||||
|
// kd> dt fieldSameNameStruct @@C++(&g_fieldSameNameStruct)
|
||||||
|
// targetapp!fieldSameNameStruct
|
||||||
|
// +0x000 m_field : 0x400
|
||||||
|
// +0x004 m_field : 12 ''
|
||||||
|
// +0x008 m_field : 0x00000001`3f7bc928 "toaster"
|
||||||
|
|
||||||
|
// kd> dt fieldSameNameStruct
|
||||||
|
// targetapp!fieldSameNameStruct
|
||||||
|
// +0x000 m_field : Int4B
|
||||||
|
// +0x004 m_field : Char
|
||||||
|
// +0x008 m_field : Ptr64 Char
|
||||||
|
|
||||||
|
// kd> ?? g_fieldSameNameStruct.m_field
|
||||||
|
// char * 0x00000001`3f04c928
|
||||||
|
// "toaster"
|
||||||
|
// kd> ?? g_fieldSameNameStruct.intermediateStruct::baseStruct1::m_field
|
||||||
|
// Type does not have given member error at 'intermediateStruct::baseStruct1::m_field'
|
||||||
|
// kd> g_fieldSameNameStruct.baseStruct2::m_field
|
||||||
|
// Type does not have given member error at 'baseStruct2::m_field'
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
WNDENUMPROC g_ptrToFunction;
|
WNDENUMPROC g_ptrToFunction;
|
||||||
void *g_unTypedPtrToFunction = g_ptrToFunction;
|
void *g_unTypedPtrToFunction = g_ptrToFunction;
|
||||||
#pragma pack( pop )
|
#pragma pack( pop )
|
||||||
@ -336,6 +387,11 @@ void FuncWithName0()
|
|||||||
std::cout << g_structNested.m_nestedFiled;
|
std::cout << g_structNested.m_nestedFiled;
|
||||||
std::cout << g_unTypedPtrToFunction;
|
std::cout << g_unTypedPtrToFunction;
|
||||||
|
|
||||||
|
std::cout << g_fieldSameNameStruct.m_field;
|
||||||
|
std::cout << g_fieldSameNameStruct.intermediateStruct::baseStruct1::m_field;
|
||||||
|
std::cout << g_fieldSameNameStruct.intermediateStruct::m_field;
|
||||||
|
std::cout << g_fieldSameNameStruct.baseStruct2::m_field;
|
||||||
|
|
||||||
std::cout << g_structTypeDef.m_field0;
|
std::cout << g_structTypeDef.m_field0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,6 +550,10 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
g_structWithNested.m_field = 34;
|
g_structWithNested.m_field = 34;
|
||||||
g_structNested.m_nestedFiled = 46;
|
g_structNested.m_nestedFiled = 46;
|
||||||
|
|
||||||
|
g_fieldSameNameStruct.m_field = "toaster";
|
||||||
|
g_fieldSameNameStruct.intermediateStruct::baseStruct1::m_field = 1024;
|
||||||
|
g_fieldSameNameStruct.baseStruct2::m_field = 0xc;
|
||||||
|
|
||||||
g_ptrToFunction = &EnumWindowsProc2;
|
g_ptrToFunction = &EnumWindowsProc2;
|
||||||
g_unTypedPtrToFunction = &EnumWindowsProc2;
|
g_unTypedPtrToFunction = &EnumWindowsProc2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user