mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-18 01:53:22 +08:00
[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
This commit is contained in:
parent
939406bae9
commit
607e8c0dc0
@ -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 );
|
||||
|
@ -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,
|
||||
|
@ -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"""
|
||||
|
Loading…
Reference in New Issue
Block a user