mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.2.x] added: method deref() may be skip ( struct.field1.deref().field2 -> struct.field1.field2 )
git-svn-id: https://pykd.svn.codeplex.com/svn@82220 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
f2daca89fc
commit
14e20d47f2
@ -199,6 +199,14 @@ TypedVarPtr PtrTypedVar::deref()
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TypedVarPtr PtrTypedVar::getField( const std::string &fieldName )
|
||||||
|
{
|
||||||
|
TypedVarPtr derefPtr = deref();
|
||||||
|
return derefPtr->getField( fieldName );
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::string PtrTypedVar::print()
|
std::string PtrTypedVar::print()
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
|
@ -134,6 +134,8 @@ public:
|
|||||||
|
|
||||||
virtual BaseTypeVariant getValue();
|
virtual BaseTypeVariant getValue();
|
||||||
|
|
||||||
|
virtual TypedVarPtr getField( const std::string &fieldName );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -219,6 +219,10 @@ class TypedVarTest( unittest.TestCase ):
|
|||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
except pykd.BaseException:
|
except pykd.BaseException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def testSkipDeref(self):
|
||||||
|
tv = target.module.typedVar( "g_structTest1" )
|
||||||
|
self.assertEqual( tv.m_field4.deref().m_field1, tv.m_field4.m_field1 )
|
||||||
|
|
||||||
def testUnNamedStruct(self):
|
def testUnNamedStruct(self):
|
||||||
tv = target.module.typedVar( "g_unNamedStruct" )
|
tv = target.module.typedVar( "g_unNamedStruct" )
|
||||||
@ -267,7 +271,7 @@ class TypedVarTest( unittest.TestCase ):
|
|||||||
self.assertTrue( str(target.module.typedVar( "g_unTypedPtrToFunction" ) ) )
|
self.assertTrue( str(target.module.typedVar( "g_unTypedPtrToFunction" ) ) )
|
||||||
|
|
||||||
def testNotValidPrint(self):
|
def testNotValidPrint(self):
|
||||||
types = ("structTest", ) #, "ULong[100]", "Ulong*" )
|
types = ("structTest", "ULong[100]", "ULong*" )
|
||||||
for ti in types:
|
for ti in types:
|
||||||
self.assertTrue( str(pykd.typedVar( target.module.type(ti), 0 ) ) )
|
self.assertTrue( str(pykd.typedVar( target.module.type(ti), 0 ) ) )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user