pykd/test/scripts/eventtest.py
SND\kernelnet_cp df0be475c8 [0.2.x] added : getCurrentProcessId routine ( Return PID of the current process ( user mode only ) )
[0.2.x] added : getCurrentThreadId routine ( Return TID of the current thread ( user mode only ) )
[0.2.x] added : eventHandler.onExecutionStatusChange method ( Triggered execution status changed )

git-svn-id: https://pykd.svn.codeplex.com/svn@82898 9b283d60-5439-405e-af05-b73fd8c4d996
2017-11-08 17:42:50 +04:00

26 lines
549 B
Python

import unittest
import target
import pykd
class handler( pykd.eventHandler ):
def __init__(self):
pykd.eventHandler.__init__(self)
self.counter=0
def onException(self, param):
self.counter += 1
return pykd.DEBUG_STATUS_NO_CHANGE
def onExecutionStatusChange(self,status):
print status
class EventTest( unittest.TestCase ):
def testDebugBreak( self ):
h = handler()
pykd.go()
pykd.go()
self.assertEqual( 2, h.counter )