[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:
SND\EreTIk_cp 2013-05-01 12:50:44 +00:00 committed by Mikhail I. Izmestev
parent ca4d73e776
commit aee8b2b1b8
6 changed files with 22 additions and 20 deletions

View File

@ -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;

View File

@ -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" );

View File

@ -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( &currentStatus ); hres = g_dbgEng->control->GetExecutionStatus( &currentStatus );
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 );
} }

View File

@ -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 )

View File

@ -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 )

View File

@ -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()