mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.1.x] fixed : typedVar can not be used as a key for map
git-svn-id: https://pykd.svn.codeplex.com/svn@72761 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
2d141abec2
commit
670659121b
@ -133,7 +133,8 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
.def( "__hex__", &intBase::hex )
|
.def( "__hex__", &intBase::hex )
|
||||||
.def( "__long__", &intBase::long_ )
|
.def( "__long__", &intBase::long_ )
|
||||||
.def( "__int__", &intBase::int_ )
|
.def( "__int__", &intBase::int_ )
|
||||||
.def( "__index__", &intBase::long_ );
|
.def( "__index__", &intBase::long_ )
|
||||||
|
.def( "__hash__", &intBase::long_ );
|
||||||
|
|
||||||
python::class_<DebugClient, DebugClientPtr>("dbgClient", "Class representing a debugging session", python::no_init )
|
python::class_<DebugClient, DebugClientPtr>("dbgClient", "Class representing a debugging session", python::no_init )
|
||||||
.def( "addr64", &DebugClient::addr64,
|
.def( "addr64", &DebugClient::addr64,
|
||||||
|
@ -130,6 +130,16 @@ class TypedVarTest( unittest.TestCase ):
|
|||||||
|
|
||||||
ind = target.module.typedVar( "g_ucharValue" )
|
ind = target.module.typedVar( "g_ucharValue" )
|
||||||
self.assertEqual( 5, [0,5,10][ind] )
|
self.assertEqual( 5, [0,5,10][ind] )
|
||||||
|
|
||||||
|
self.assertTrue( ind in [0,1,2] )
|
||||||
|
|
||||||
tv = target.module.typedVar( "g_struct3" )
|
tv = target.module.typedVar( "g_struct3" )
|
||||||
self.assertEqual( 2, tv.m_arrayField[ind] )
|
self.assertEqual( 2, tv.m_arrayField[ind] )
|
||||||
|
|
||||||
|
ind = target.module.typedVar( "g_ulongValue" )
|
||||||
|
self.assertEqual( 4, ind )
|
||||||
|
self.assertTrue( ind in { 1 : "1", 4 : "2" } )
|
||||||
|
self.assertEqual( "2", { 1 : "1", 4 : "2" }[ind] )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user