def testGetSize( self ): tv1 = target.module.typedVar( "structTest", target.module.g_structTest ) self.assertEqual( 16 + pykd.ptrSize(), tv1.sizeof() ) tv2 = target.module.typedVar( "structTest[2]", target.module.g_testArray ) self.assertEqual( tv1.sizeof()*2, tv2.sizeof() ) self.assertEqual( pykd.sizeof("g_structTest"), tv1.sizeof() ) self.assertEqual( pykd.sizeof("g_testArray"), tv2.sizeof() ) self.assertEqual( pykd.sizeof("g_ucharValue"), 1 )
def testSize(self): ti1 = target.module.type("structTest") self.assertEqual(16 + pykd.ptrSize(), ti1.size()) self.assertEqual(pykd.ptrSize(), target.module.type("structTest**").size()) self.assertEqual(pykd.sizeof("structTest"), target.module.type("structTest").size()) self.assertEqual(pykd.sizeof("structTest**"), target.module.type("structTest**").size()) self.assertEqual(pykd.sizeof("Int1B"), pykd.typeInfo("Int1B").size())
def addTableChilds( table, links ): table.append( links.getAddress() + sizeof( "nt!_RTL_BALANCED_LINKS" ) ) if links.LeftChild != 0: addTableChilds( table, typedVar("nt!_RTL_BALANCED_LINKS", links.LeftChild) ) if links.RightChild != 0: addTableChilds( table, typedVar("nt!_RTL_BALANCED_LINKS", links.RightChild) )