mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 19:53:22 +08:00
[0.2.x] ~recovered WaitEventException
git-svn-id: https://pykd.svn.codeplex.com/svn@83541 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
ca4d73e776
commit
aee8b2b1b8
@ -89,6 +89,9 @@ std::string DiaException::makeFullDesc(const std::string &desc, HRESULT hres, ID
|
|||||||
_CASE_DIA_ERROR(SYMSRV_CACHE_FULL);
|
_CASE_DIA_ERROR(SYMSRV_CACHE_FULL);
|
||||||
|
|
||||||
#undef _CASE_DIA_ERROR
|
#undef _CASE_DIA_ERROR
|
||||||
|
|
||||||
|
case S_FALSE: sstream << ": S_FALSE" << std::endl; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
PCHAR errMessage = NULL;
|
PCHAR errMessage = NULL;
|
||||||
|
@ -655,7 +655,7 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
|
|
||||||
pykd::exception<DbgException>( "BaseException", "Pykd base exception class" );
|
pykd::exception<DbgException>( "BaseException", "Pykd base exception class" );
|
||||||
pykd::exception<MemoryException,DbgException>( "MemoryException", "Target memory access exception class" );
|
pykd::exception<MemoryException,DbgException>( "MemoryException", "Target memory access exception class" );
|
||||||
//pykd::exception<WaitEventException,DbgException>( "WaitEventException", "Debug interface access exception" );
|
pykd::exception<WaitEventException,DbgException>( "WaitEventException", "None of the targets could generate events" );
|
||||||
pykd::exception<WrongEventTypeException,DbgException>( "WrongEventTypeException", "Unknown last event type" );
|
pykd::exception<WrongEventTypeException,DbgException>( "WrongEventTypeException", "Unknown last event type" );
|
||||||
pykd::exception<SymbolException,DbgException>( "SymbolException", "Symbol exception" );
|
pykd::exception<SymbolException,DbgException>( "SymbolException", "Symbol exception" );
|
||||||
//pykd::exception<pyDia::Exception,SymbolException>( "DiaException", "Debug interface access exception" );
|
//pykd::exception<pyDia::Exception,SymbolException>( "DiaException", "Debug interface access exception" );
|
||||||
|
@ -110,12 +110,16 @@ void debugGo()
|
|||||||
do {
|
do {
|
||||||
hres = g_dbgEng->control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
|
hres = g_dbgEng->control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
|
||||||
if ( FAILED( hres ) )
|
if ( FAILED( hres ) )
|
||||||
throw DbgException( "IDebugControl::WaitForEvent failed" );
|
{
|
||||||
|
if (E_UNEXPECTED == hres)
|
||||||
|
throw WaitEventException();
|
||||||
|
throw DbgException( "IDebugControl::WaitForEvent", hres );
|
||||||
|
}
|
||||||
|
|
||||||
hres = g_dbgEng->control->GetExecutionStatus( ¤tStatus );
|
hres = g_dbgEng->control->GetExecutionStatus( ¤tStatus );
|
||||||
|
|
||||||
if ( FAILED( hres ) )
|
if ( FAILED( hres ) )
|
||||||
throw DbgException( "IDebugControl::GetExecutionStatus failed" );
|
throw DbgException( "IDebugControl::GetExecutionStatus", hres );
|
||||||
|
|
||||||
} while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE );
|
} while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE );
|
||||||
}
|
}
|
||||||
|
@ -34,15 +34,8 @@ class EhStatusTest(unittest.TestCase):
|
|||||||
|
|
||||||
statusChangeHandler = StatusChangeHandler()
|
statusChangeHandler = StatusChangeHandler()
|
||||||
|
|
||||||
try:
|
self.assertRaises(pykd.WaitEventException, testutils.infGo)
|
||||||
|
|
||||||
while True:
|
|
||||||
pykd.go()
|
|
||||||
except pykd.BaseException:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
self.assertEqual( 2, statusChangeHandler.breakCount )
|
self.assertEqual( 2, statusChangeHandler.breakCount )
|
||||||
self.assertEqual( 1, statusChangeHandler.noDebuggee )
|
self.assertEqual( 1, statusChangeHandler.noDebuggee )
|
||||||
self.assertEqual( statusChangeHandler.breakCount + statusChangeHandler.noDebuggee , statusChangeHandler.goCount )
|
self.assertEqual( statusChangeHandler.breakCount + statusChangeHandler.noDebuggee , statusChangeHandler.goCount )
|
||||||
|
|
@ -40,9 +40,6 @@ class EhSymbolsTest(unittest.TestCase):
|
|||||||
pykd.dbgCommand(".reload /u")
|
pykd.dbgCommand(".reload /u")
|
||||||
self.assertTrue( symbolsStateHandler.unloadAllModulesTrigged )
|
self.assertTrue( symbolsStateHandler.unloadAllModulesTrigged )
|
||||||
|
|
||||||
try:
|
self.assertRaises(pykd.WaitEventException, testutils.infGo)
|
||||||
while True:
|
|
||||||
pykd.go()
|
|
||||||
except pykd.BaseException:
|
|
||||||
pass
|
|
||||||
self.assertTrue( "iphlpapi" in symbolsStateHandler.modNames )
|
self.assertTrue( "iphlpapi" in symbolsStateHandler.modNames )
|
||||||
|
@ -23,3 +23,8 @@ class KillProcess:
|
|||||||
pykd.killProcess( self.processId )
|
pykd.killProcess( self.processId )
|
||||||
pykd.detachProcess( self.processId )
|
pykd.detachProcess( self.processId )
|
||||||
|
|
||||||
|
def infGo():
|
||||||
|
"""Infinite pykd.go call"""
|
||||||
|
while True:
|
||||||
|
pykd.go()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user