[0.3.x] added : module.typedVar can accept python byte sequance

git-svn-id: https://pykd.svn.codeplex.com/svn@91218 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\ussrhero_cp 2017-04-22 12:30:46 +00:00 committed by Mikhail I. Izmestev
parent 9cf68441ae
commit 16c796799b
2 changed files with 51 additions and 52 deletions

View File

@ -920,7 +920,6 @@ BOOST_PYTHON_MODULE( pykd )
#endif #endif
; ;
python::class_<kdlib::TypedVar, kdlib::TypedVarPtr, python::bases<kdlib::NumBehavior>, boost::noncopyable >("typedVar", python::class_<kdlib::TypedVar, kdlib::TypedVarPtr, python::bases<kdlib::NumBehavior>, boost::noncopyable >("typedVar",
"Class of non-primitive type object, child class of typeClass. Data from target is copied into object instance", python::no_init ) "Class of non-primitive type object, child class of typeClass. Data from target is copied into object instance", python::no_init )
.def("__init__", python::make_constructor(pykd::getTypedVarByName) ) .def("__init__", python::make_constructor(pykd::getTypedVarByName) )

View File

@ -11,6 +11,7 @@
#include "stladaptor.h" #include "stladaptor.h"
#include "pythreadstate.h" #include "pythreadstate.h"
#include "dbgexcept.h" #include "dbgexcept.h"
#include "pytypedvar.h"
namespace pykd { namespace pykd {
@ -125,10 +126,9 @@ struct ModuleAdapter : public kdlib::Module
return module.getTypedVarByName(symbolName); return module.getTypedVarByName(symbolName);
} }
static kdlib::TypedVarPtr getTypedVarByTypeName( kdlib::Module& module, const std::wstring &typeName, kdlib::MEMOFFSET_64 offset ) static kdlib::TypedVarPtr getTypedVarByTypeName( kdlib::Module& module, const std::wstring &typeName, python::object& dataStorage )
{ {
AutoRestorePyState pystate; return getTypedVarByTypeInfo( getTypeByName(module, typeName), dataStorage);
return module.getTypedVarByTypeName(typeName, offset);
} }
static kdlib::TypedVarPtr getTypedVarWithPrototype(kdlib::Module& module, const std::wstring &symbolName, const std::wstring &prototype) static kdlib::TypedVarPtr getTypedVarWithPrototype(kdlib::Module& module, const std::wstring &symbolName, const std::wstring &prototype)