mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.1.x] +unnamed struct test
git-svn-id: https://pykd.svn.codeplex.com/svn@73285 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
e8906c5d2c
commit
858c5f2492
@ -163,3 +163,8 @@ class TypedVarTest( unittest.TestCase ):
|
|||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
except pykd.BaseException:
|
except pykd.BaseException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def testUnNamedStruct(self):
|
||||||
|
tv = target.module.typedVar( "g_unNamedStruct" )
|
||||||
|
self.assertEqual( 4, tv.m_fieldNestedStruct )
|
||||||
|
self.assertEqual( 5, tv.m_fieldOfUnNamed )
|
||||||
|
@ -197,6 +197,13 @@ listStruct1 g_listItem11 = { 100 };
|
|||||||
listStruct1 g_listItem12 = { 200 };
|
listStruct1 g_listItem12 = { 200 };
|
||||||
listStruct1 g_listItem13 = { 300 };
|
listStruct1 g_listItem13 = { 300 };
|
||||||
|
|
||||||
|
struct {
|
||||||
|
struct {
|
||||||
|
int m_fieldNestedStruct;
|
||||||
|
};
|
||||||
|
int m_fieldOfUnNamed;
|
||||||
|
}g_unNamedStruct;
|
||||||
|
|
||||||
#pragma pack( pop )
|
#pragma pack( pop )
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -257,6 +264,7 @@ void FuncWithName0()
|
|||||||
std::cout << ptrIntMatrix1;
|
std::cout << ptrIntMatrix1;
|
||||||
std::cout << g_bigValue;
|
std::cout << g_bigValue;
|
||||||
std::cout << g_classChild.m_enumField;
|
std::cout << g_classChild.m_enumField;
|
||||||
|
std::cout << g_unNamedStruct.m_fieldNestedStruct;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -274,6 +282,7 @@ void FuncWithName1(int a)
|
|||||||
std::cout << _structTest.m_field1;
|
std::cout << _structTest.m_field1;
|
||||||
std::cout << _struct2.m_struct.m_field1;
|
std::cout << _struct2.m_struct.m_field1;
|
||||||
std::cout << g_string;
|
std::cout << g_string;
|
||||||
|
std::cout << g_unNamedStruct.m_fieldOfUnNamed;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -318,6 +327,23 @@ int doLoadUnload()
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int doExeptions()
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
|
||||||
|
PUCHAR _ptr = reinterpret_cast<UCHAR *>(2);
|
||||||
|
__try {
|
||||||
|
*_ptr = 5;
|
||||||
|
} __except(EXCEPTION_EXECUTE_HANDLER) {
|
||||||
|
}
|
||||||
|
|
||||||
|
++_ptr;
|
||||||
|
*_ptr = 6;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -348,6 +374,9 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
g_childListEntry2.m_next = &g_childListEntry3;
|
g_childListEntry2.m_next = &g_childListEntry3;
|
||||||
g_childListEntry3.m_next = NULL;
|
g_childListEntry3.m_next = NULL;
|
||||||
|
|
||||||
|
g_unNamedStruct.m_fieldNestedStruct = 4;
|
||||||
|
g_unNamedStruct.m_fieldOfUnNamed = 5;
|
||||||
|
|
||||||
// Let test scripts to execute
|
// Let test scripts to execute
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
|
|
||||||
@ -363,6 +392,9 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
::EnumWindows(&EnumWindowsProc2, 7);
|
::EnumWindows(&EnumWindowsProc2, 7);
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !_tcsicmp(argv[1], _T("-testExceptions")) )
|
||||||
|
return doExeptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
|
Loading…
Reference in New Issue
Block a user