From eeb802ff33be080f99dc503b71d3535185b5b7f0 Mon Sep 17 00:00:00 2001 From: ussrhero Date: Thu, 4 Oct 2018 23:55:23 +0300 Subject: [PATCH] added : stackFrame.switchTo( switch to this frame ) --- kdlibcpp | 2 +- pykd/pycpucontext.h | 6 ++++++ pykd/pymod.cpp | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kdlibcpp b/kdlibcpp index 65930b3..b92e0fb 160000 --- a/kdlibcpp +++ b/kdlibcpp @@ -1 +1 @@ -Subproject commit 65930b3307d248503d3c1051f61b50476437845b +Subproject commit b92e0fbcc0628b2e8dc320f79a2bb9464b8d9908 diff --git a/pykd/pycpucontext.h b/pykd/pycpucontext.h index b51f054..0fb60bd 100644 --- a/pykd/pycpucontext.h +++ b/pykd/pycpucontext.h @@ -64,6 +64,12 @@ public: return frame->getStaticVar(paramName); return frame->getLocalVar(paramName); } + + static void switchTo(kdlib::StackFramePtr& frame) + { + AutoRestorePyState pystate; + frame->switchTo(); + } }; ///////////////////////////////////////////////////////////////////////////////// diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index b11dc91..92c4f9b 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -1097,6 +1097,8 @@ void pykd_init() "return a set of function's local variables as a dict ( name : value)") .def( "getLocal", StackFrameAdapter::getLocal, "return the function's local variable by it's name") + .def( "switchTo", StackFrameAdapter::switchTo, + "Make this frame a current") .def( "__str__", StackFrameAdapter::print ); python::class_("cpu", "class for CPU context representation" )