[0.3.x] added : added EventHandler::onChangeLocalScope ( the current local scope has been changed )

git-svn-id: https://pykd.svn.codeplex.com/svn@89457 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2014-12-14 11:04:02 +00:00 committed by Mikhail I. Izmestev
parent cd271d70ec
commit 3e03e588ef
4 changed files with 29 additions and 2 deletions

View File

@ -264,6 +264,28 @@ void EventHandler::onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid)
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
void EventHandler::onChangeLocalScope()
{
PyEval_RestoreThread( m_pystate );
try {
python::override pythonHandler = get_override("onChangeLocalScope");
if ( pythonHandler )
{
pythonHandler();
}
}
catch (const python::error_already_set &)
{
printException();
}
m_pystate = PyEval_SaveThread();
}
/////////////////////////////////////////////////////////////////////////////////
Breakpoint::Breakpoint(kdlib::BreakpointPtr bp) Breakpoint::Breakpoint(kdlib::BreakpointPtr bp)
{ {
m_pystate = PyThreadState_Get(); m_pystate = PyThreadState_Get();

View File

@ -34,6 +34,7 @@ public:
virtual kdlib::DebugCallbackResult onModuleLoad( kdlib::MEMOFFSET_64 offset, const std::wstring &name ); virtual kdlib::DebugCallbackResult onModuleLoad( kdlib::MEMOFFSET_64 offset, const std::wstring &name );
virtual kdlib::DebugCallbackResult onModuleUnload( kdlib::MEMOFFSET_64 offset, const std::wstring &name ); virtual kdlib::DebugCallbackResult onModuleUnload( kdlib::MEMOFFSET_64 offset, const std::wstring &name );
virtual void onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid); virtual void onCurrentThreadChange(kdlib::THREAD_DEBUG_ID threadid);
virtual void onChangeLocalScope();
private: private:

View File

@ -2,7 +2,7 @@
#define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MAJOR 0
#define PYKD_VERSION_MINOR 3 #define PYKD_VERSION_MINOR 3
#define PYKD_VERSION_SUBVERSION 0 #define PYKD_VERSION_SUBVERSION 0
#define PYKD_VERSION_BUILDNO 13 #define PYKD_VERSION_BUILDNO 14
#define __VER_STR2__(x) #x #define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x) #define __VER_STR1__(x) __VER_STR2__(x)

View File

@ -894,8 +894,12 @@ BOOST_PYTHON_MODULE( pykd )
"Triggered execution status changed. Parameter - execution status.\n" "Triggered execution status changed. Parameter - execution status.\n"
"There is no return value" ) "There is no return value" )
.def( "onCurrentThreadChange", &EventHandler::onCurrentThreadChange, .def( "onCurrentThreadChange", &EventHandler::onCurrentThreadChange,
"The current thread has changed, which implies that the current target and current process might also have changed.\n" "The current thread has been changed, which implies that the current target and current process might also have changed.\n"
"There is no return value" ) "There is no return value" )
.def( "onChangeLocalScope", &EventHandler::onChangeLocalScope,
"The current local scope has been changed.\n"
"There is no return value" )
// .def( "onSymbolsLoaded", &EventHandlerWrap::onSymbolsLoaded, // .def( "onSymbolsLoaded", &EventHandlerWrap::onSymbolsLoaded,
// "Triggered debug symbols loaded. Parameter - module base or 0\n" // "Triggered debug symbols loaded. Parameter - module base or 0\n"
// "There is no return value") // "There is no return value")