mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 19:53:22 +08:00
[0.1.x] fixed : pykd routines can not convert parameters to long
git-svn-id: https://pykd.svn.codeplex.com/svn@74113 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
1f05ab7431
commit
30795b3ef9
@ -1,9 +1,12 @@
|
||||
|
||||
[!] fixed : issue #10336 ( pykd routines can not convert parameters to long )
|
||||
|
||||
version 0.1.0.7 30/01/2012
|
||||
|
||||
[+] added : cpuReg class
|
||||
[+] added : getLocals method for the class stackFrame
|
||||
[+] added : checksum method for the class module
|
||||
[+] added : timestam method for the class module
|
||||
[+] added : timestamp method for the class module
|
||||
|
||||
|
||||
version 0.1.0.6 20/01/2012
|
||||
|
@ -150,8 +150,10 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
.def( "__long__", &intBase::long_ )
|
||||
.def( "__int__", &intBase::int_ )
|
||||
.def( "__index__", &intBase::long_ )
|
||||
.def( "__hash__", &intBase::long_ )
|
||||
.def( "__coerce__", &intBase::coerce );
|
||||
.def( "__hash__", &intBase::long_ );
|
||||
|
||||
python::implicitly_convertible<intBase,ULONG64>();
|
||||
python::implicitly_convertible<intBase,LONG64>();
|
||||
|
||||
python::class_<DebugClient, DebugClientPtr>("dbgClient", "Class representing a debugging session", python::no_init )
|
||||
.def( "addr64", &DebugClient::addr64,
|
||||
|
@ -53,6 +53,34 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class VariantToULong64 : public boost::static_visitor<ULONG64>
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
ULONG64 operator()(T i ) const {
|
||||
return static_cast<ULONG64>( i );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class VariantToLong : public boost::static_visitor<LONG>
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
LONG operator()(T i ) const {
|
||||
return static_cast<LONG>( i );
|
||||
}
|
||||
};
|
||||
|
||||
class VariantToLong64 : public boost::static_visitor<LONG64>
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
LONG64 operator()(T i ) const {
|
||||
return static_cast<LONG64>( i );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class intBase {
|
||||
|
||||
@ -185,11 +213,23 @@ public:
|
||||
return boost::apply_visitor( VariantToPyobj(), getValue() ) != 0;
|
||||
}
|
||||
|
||||
python::object coerce() {
|
||||
__debugbreak();
|
||||
return python::object();
|
||||
operator ULONG64() {
|
||||
return boost::apply_visitor( VariantToULong64(), getValue() );
|
||||
}
|
||||
|
||||
operator ULONG() {
|
||||
return boost::apply_visitor( VariantToULong(), getValue() );
|
||||
}
|
||||
|
||||
operator LONG64() {
|
||||
return boost::apply_visitor( VariantToLong64(), getValue() );
|
||||
}
|
||||
|
||||
operator LONG() {
|
||||
return boost::apply_visitor( VariantToLong(), getValue() );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
virtual BaseTypeVariant getValue() {
|
||||
@ -224,4 +264,7 @@ private:
|
||||
BaseTypeVariant m_variant;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
@ -169,7 +169,7 @@ class TypedVarTest( unittest.TestCase ):
|
||||
self.assertEqual( 4, tv.m_fieldNestedStruct )
|
||||
self.assertEqual( 5, tv.m_fieldOfUnNamed )
|
||||
|
||||
def testPointerToFunction( self ):
|
||||
def testPointerToFunction(self):
|
||||
tv1 = target.module.typedVar( "g_unTypedPtrToFunction" )
|
||||
|
||||
# if debug: g_unTypedPtrToFunction point to jmp EnumWindowsProc2 (e9 xxxxxxxx)
|
||||
@ -181,3 +181,10 @@ class TypedVarTest( unittest.TestCase ):
|
||||
|
||||
self.assertRaises( pykd.TypeException, tv1.deref )
|
||||
self.assertRaises( pykd.TypeException, tv2.deref )
|
||||
|
||||
|
||||
def testTypeVarArg(self):
|
||||
tv1 = target.module.typedVar( "structTest", target.module.g_structTest )
|
||||
tv2 = target.module.typedVar( "structTest", tv1 )
|
||||
self.assertEqual( tv1, tv2 )
|
||||
self.assertTrue( tv1 )
|
||||
|
Loading…
Reference in New Issue
Block a user