mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.2.x] fixed : onExecutionStatusChange triggers break after target has been already stopped
git-svn-id: https://pykd.svn.codeplex.com/svn@83224 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
1ad8bf412b
commit
31d0a615f9
@ -1223,6 +1223,9 @@ HRESULT STDMETHODCALLTYPE DebugEngine::ChangeEngineState(
|
|||||||
( ( Argument & DEBUG_STATUS_INSIDE_WAIT ) == 0 ) &&
|
( ( Argument & DEBUG_STATUS_INSIDE_WAIT ) == 0 ) &&
|
||||||
(ULONG)Argument != previousExecutionStatus )
|
(ULONG)Argument != previousExecutionStatus )
|
||||||
{
|
{
|
||||||
|
if ( previousExecutionStatus == DEBUG_STATUS_NO_DEBUGGEE &&
|
||||||
|
(ULONG)Argument != DEBUG_STATUS_GO )
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
for ( ; it != m_handlers.end(); ++it )
|
for ( ; it != m_handlers.end(); ++it )
|
||||||
{
|
{
|
||||||
|
@ -11,13 +11,15 @@ class StatusChangeHandler(pykd.eventHandler):
|
|||||||
pykd.eventHandler.__init__(self)
|
pykd.eventHandler.__init__(self)
|
||||||
self.breakCount = 0
|
self.breakCount = 0
|
||||||
self.goCount = 0
|
self.goCount = 0
|
||||||
|
self.noDebuggee = 0
|
||||||
|
|
||||||
def onExecutionStatusChange(self, executionStatus):
|
def onExecutionStatusChange(self, executionStatus):
|
||||||
if executionStatus == pykd.executionStatus.Break:
|
if executionStatus == pykd.executionStatus.Break:
|
||||||
self.breakCount = self.breakCount + 1
|
self.breakCount += 1
|
||||||
if executionStatus == pykd.executionStatus.Go:
|
if executionStatus == pykd.executionStatus.Go:
|
||||||
self.goCount = self.goCount + 1
|
self.goCount += 1
|
||||||
|
if executionStatus == pykd.executionStatus.NoDebuggee:
|
||||||
|
self.noDebuggee += 1
|
||||||
|
|
||||||
|
|
||||||
class EhStatusTest(unittest.TestCase):
|
class EhStatusTest(unittest.TestCase):
|
||||||
@ -32,9 +34,15 @@ class EhStatusTest(unittest.TestCase):
|
|||||||
|
|
||||||
statusChangeHandler = StatusChangeHandler()
|
statusChangeHandler = StatusChangeHandler()
|
||||||
|
|
||||||
pykd.go()
|
try:
|
||||||
pykd.go()
|
|
||||||
|
while True:
|
||||||
|
pykd.go()
|
||||||
|
except pykd.BaseException:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
self.assertEqual( 2, statusChangeHandler.breakCount )
|
self.assertEqual( 2, statusChangeHandler.breakCount )
|
||||||
self.assertEqual( statusChangeHandler.breakCount, statusChangeHandler.goCount )
|
self.assertEqual( 1, statusChangeHandler.noDebuggee )
|
||||||
|
self.assertEqual( statusChangeHandler.breakCount + statusChangeHandler.noDebuggee , statusChangeHandler.goCount )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user