From 607e8c0dc0f236383fcdb9dc1d3c08843e303a81 Mon Sep 17 00:00:00 2001 From: "SND\\ussrhero_cp" Date: Tue, 3 Mar 2015 20:59:10 +0000 Subject: [PATCH] [0.3.x] renamed : onModuleLoad method to onLoadModule ( like in 0.2.x version ) git-svn-id: https://pykd.svn.codeplex.com/svn@89812 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pyeventhandler.cpp | 4 ++-- pykd/pymod.cpp | 4 ++-- test/scripts/ehloadtest.py | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pykd/pyeventhandler.cpp b/pykd/pyeventhandler.cpp index 7276a94..bd494a8 100644 --- a/pykd/pyeventhandler.cpp +++ b/pykd/pyeventhandler.cpp @@ -150,7 +150,7 @@ kdlib::DebugCallbackResult EventHandler::onModuleLoad( kdlib::MEMOFFSET_64 offs do { - python::override pythonHandler = get_override( "onModuleLoad" ); + python::override pythonHandler = get_override( "onLoadModule" ); if ( !pythonHandler ) { result = kdlib::EventHandler::onModuleLoad( offset, name ); @@ -201,7 +201,7 @@ kdlib::DebugCallbackResult EventHandler::onModuleUnload( kdlib::MEMOFFSET_64 of do { - python::override pythonHandler = get_override( "onModuleUnload" ); + python::override pythonHandler = get_override( "onUnloadModule" ); if ( !pythonHandler ) { result = kdlib::EventHandler::onModuleUnload( offset, name ); diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 5470ee2..402ef96 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -954,10 +954,10 @@ BOOST_PYTHON_MODULE( pykd ) .def( "onBreakpoint", &EventHandler::onBreakpoint, "Triggered breakpoint event. Parameter is int: ID of breakpoint\n" "For ignore event method must return eventResult.noChange" ) - .def( "onModuleLoad", &EventHandler::onModuleLoad, + .def( "onLoadModule", &EventHandler::onModuleLoad, "Triggered module load event. Parameter are long: module base, string: module name\n" "For ignore event method must return eventResult.noChange" ) - .def( "onModuleUnload", &EventHandler::onModuleUnload, + .def( "onUnloadModule", &EventHandler::onModuleUnload, "Triggered module unload event. Parameter are long: module base, string: module name\n" "For ignore event method must return eventResult.noChange" ) .def( "onException", &EventHandler::onException, diff --git a/test/scripts/ehloadtest.py b/test/scripts/ehloadtest.py index a93da37..745434e 100644 --- a/test/scripts/ehloadtest.py +++ b/test/scripts/ehloadtest.py @@ -16,21 +16,21 @@ class ModuleLoadHandler(pykd.eventHandler): self.wasLoad = 0 self.wasUnload = False - def onModuleLoad(self, module): + def onLoadModule(self, modBase, name): """Load module handler""" - if ( fnmatch.fnmatch(module.name().lower(), self.moduleMask) ): - self.wasLoad = module.begin() + if ( fnmatch.fnmatch(name.lower(), self.moduleMask) ): + self.wasLoad = modBase - return pykd.DEBUG_STATUS_NO_CHANGE + return pykd.executionStatus.NoChange - def onModuleUnload(self, modBase): + def onUnloadModule(self, modBase, name): """Unload module handler""" if ( self.wasLoad and (self.wasLoad == modBase) ): self.wasUnload = True - return pykd.DEBUG_STATUS_NO_CHANGE + return pykd.executionStatus.NoChange class EhLoadTest(unittest.TestCase): """Unit tests of [un-]load modules notification"""