pykd 0.3 doesn't work eventHandler onLoadModule

Mar 2, 2015 at 10:48 PM
Edited Mar 2, 2015 at 10:50 PM
from pykd import *

class MyEventHandler(eventHandler):
    def onLoadModule(self, module):
        dprintln("onLoadModule_2134 ()")
        return DEBUG_STATUS_BREAK 

myHandler = MyEventHandler()
dprintln("Hello world")
go()
I attach debugger to the calc.exe
Load pykd and run script: .load pykd; !py C:\dbg;
I see "Hello world" , and thats all ( I don't see any messages with 'onLoadModule_2134' ((
Why ?

OS windows XP sp3, debugger 6.12
Python 2.7 x86
Coordinator
Mar 3, 2015 at 6:49 AM
I'm so sorry ((.
I've found 0.3.x version change events names:
0.2.x - onLoadModule 0.3.x - onModuleLoad
0.2.x - onUnloadModule 0.3.x - onModuleUnload

I'm going to change names back.
Developer
Mar 3, 2015 at 8:09 PM
I've renamed methods like they were in 0.2.x:
onLoadModule
onUnloadModule

But there are still some incompabilties with original scripts:
1)
def onLoadModule(self, module) - this is prototype form pykd 0.1

0.2.x and 0.3.x versions has another method signature:
def onLoadModule(self, moduleStart, moduleName) - the module object is not constructed for any call

2)
All constants were removed from global scope of the pykd. For execution status see: https://pykd.codeplex.com/wikipage?title=PYKD%200.3.%20API%20Reference&referringTitle=Documentation#executionStatus

So, for pykd 0.3 this script should be reworked:
from pykd import *

class MyEventHandler(eventHandler):
    def onLoadModule(self, moduleStart, moduleName):  # methos renamed in the 89812 changeset (pykd 0.3.0.20 )
        dprintln("onLoadModule_2134 ()")
        return executionStatus.Break

myHandler = MyEventHandler()
dprintln("Hello world")
go()
Mar 3, 2015 at 10:35 PM
Edited Mar 3, 2015 at 10:36 PM
Thank you
i have known about another method signature already.