mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 02:53:22 +08:00
[0.3.x] added : typedVar constructor allowing to set function prototype to work with overloaded functions
git-svn-id: https://pykd.svn.codeplex.com/svn@91106 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
8361ab5243
commit
683241ce2f
@ -916,6 +916,7 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
.def("__init__", python::make_constructor(pykd::getTypedVarByName) )
|
||||
.def("__init__", python::make_constructor(pykd::getTypedVarByTypeName) )
|
||||
.def("__init__", python::make_constructor(pykd::getTypedVarByTypeInfo) )
|
||||
.def("__init__", python::make_constructor(pykd::getTypedVarWithPrototype) )
|
||||
.def("getLocation", TypedVarAdapter::getLocation,
|
||||
"Return location of the varibale")
|
||||
.def("getAddress", TypedVarAdapter::getAddress,
|
||||
|
@ -32,6 +32,12 @@ inline kdlib::TypedVarPtr getTypedVarByTypeInfo( const kdlib::TypeInfoPtr &type
|
||||
return kdlib::loadTypedVar( typeInfo, addr );
|
||||
}
|
||||
|
||||
inline kdlib::TypedVarPtr getTypedVarWithPrototype( const std::wstring &name, const std::wstring &prototype)
|
||||
{
|
||||
AutoRestorePyState pystate;
|
||||
return kdlib::loadTypedVar(name, prototype);
|
||||
}
|
||||
|
||||
python::list getTypedVarListByTypeName( kdlib::MEMOFFSET_64 offset, const std::wstring &typeName, const std::wstring &fieldName );
|
||||
python::list getTypedVarListByType( kdlib::MEMOFFSET_64 offset, kdlib::TypeInfoPtr &typeInfo, const std::wstring &fieldName );
|
||||
python::list getTypedVarArrayByTypeName( kdlib::MEMOFFSET_64 offset, const std::wstring &typeName, size_t number );
|
||||
|
@ -86,7 +86,7 @@ class ModuleTest( unittest.TestCase ):
|
||||
fileName = pykd.getSourceFile(target.module.CdeclFunc )
|
||||
self.assertTrue( re.search('testfunc\\.cpp', fileName ) )
|
||||
fileName, lineNo, displacement = pykd.getSourceLine( target.module.CdeclFunc + 2)
|
||||
self.assertEqual( 18, lineNo )
|
||||
self.assertEqual( 27, lineNo )
|
||||
self.assertTrue( re.search('testfunc\\.cpp', fileName ) )
|
||||
self.assertEqual( 2, displacement )
|
||||
#fileName, lineNo, displacement = pykd.getSourceLine()
|
||||
|
Loading…
Reference in New Issue
Block a user