added : stackFrame.switchTo( switch to this frame )

This commit is contained in:
ussrhero 2018-10-04 23:55:23 +03:00
parent 3305c6d980
commit eeb802ff33
3 changed files with 9 additions and 1 deletions

@ -1 +1 @@
Subproject commit 65930b3307d248503d3c1051f61b50476437845b Subproject commit b92e0fbcc0628b2e8dc320f79a2bb9464b8d9908

View File

@ -64,6 +64,12 @@ public:
return frame->getStaticVar(paramName); return frame->getStaticVar(paramName);
return frame->getLocalVar(paramName); return frame->getLocalVar(paramName);
} }
static void switchTo(kdlib::StackFramePtr& frame)
{
AutoRestorePyState pystate;
frame->switchTo();
}
}; };
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////

View File

@ -1097,6 +1097,8 @@ void pykd_init()
"return a set of function's local variables as a dict ( name : value)") "return a set of function's local variables as a dict ( name : value)")
.def( "getLocal", StackFrameAdapter::getLocal, .def( "getLocal", StackFrameAdapter::getLocal,
"return the function's local variable by it's name") "return the function's local variable by it's name")
.def( "switchTo", StackFrameAdapter::switchTo,
"Make this frame a current")
.def( "__str__", StackFrameAdapter::print ); .def( "__str__", StackFrameAdapter::print );
python::class_<CPUContextAdapter>("cpu", "class for CPU context representation" ) python::class_<CPUContextAdapter>("cpu", "class for CPU context representation" )