From b1bf26e0af5b2899cbde25ff94b988eac5d42f63 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Tue, 17 May 2016 09:57:37 +0000 Subject: [PATCH] [0.3.x] added : onChangeSymbolPaths event ( Symbol paths has been changed ) git-svn-id: https://pykd.svn.codeplex.com/svn@90985 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pyeventhandler.cpp | 23 +++++++++++++++++++++++ pykd/pyeventhandler.h | 1 + pykd/pykdver.h | 2 +- pykd/pymod.cpp | 3 +++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pykd/pyeventhandler.cpp b/pykd/pyeventhandler.cpp index 099186e..69e1bc1 100644 --- a/pykd/pyeventhandler.cpp +++ b/pykd/pyeventhandler.cpp @@ -421,6 +421,29 @@ void EventHandler::onChangeLocalScope() m_pystate = PyEval_SaveThread(); } + +///////////////////////////////////////////////////////////////////////////////// + +void EventHandler::onChangeSymbolPaths() +{ + PyEval_RestoreThread( m_pystate ); + + try { + + python::override pythonHandler = get_override("onChangeSymbolPaths"); + if ( pythonHandler ) + { + pythonHandler(); + } + } + catch (const python::error_already_set &) + { + printException(); + } + + m_pystate = PyEval_SaveThread(); +} + ///////////////////////////////////////////////////////////////////////////////// void EventHandler::onChangeBreakpoints() diff --git a/pykd/pyeventhandler.h b/pykd/pyeventhandler.h index 127409d..c16f452 100644 --- a/pykd/pyeventhandler.h +++ b/pykd/pyeventhandler.h @@ -38,6 +38,7 @@ public: virtual void onExecutionStatusChange(kdlib::ExecutionStatus executionStatus); virtual void onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid); virtual void onChangeLocalScope(); + virtual void onChangeSymbolPaths(); virtual void onChangeBreakpoints(); virtual void onDebugOutput(const std::wstring& text); virtual void onStartInput(); diff --git a/pykd/pykdver.h b/pykd/pykdver.h index 7c6a80f..f6bd630 100644 --- a/pykd/pykdver.h +++ b/pykd/pykdver.h @@ -2,7 +2,7 @@ #define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MINOR 3 #define PYKD_VERSION_SUBVERSION 1 -#define PYKD_VERSION_BUILDNO 1 +#define PYKD_VERSION_BUILDNO 3 #define __VER_STR2__(x) #x #define __VER_STR1__(x) __VER_STR2__(x) diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 599c886..72de152 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -1127,6 +1127,9 @@ BOOST_PYTHON_MODULE( pykd ) .def( "onChangeLocalScope", &EventHandler::onChangeLocalScope, "The current local scope has been changed.\n" "There is no return value" ) + .def("onChangeSymbolPaths", &EventHandler::onChangeSymbolPaths, + "Symbol paths has been changed.\n" + "There is no return value" ) .def("onChangeBreakpoints", &EventHandler::onChangeBreakpoints, "Breakpoints is changed for current process" ) .def( "onDebugOutput", &EventHandler::onDebugOutput,