[0.2.x] added : breakin routine

git-svn-id: https://pykd.svn.codeplex.com/svn@78886 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2012-08-16 15:31:51 +00:00 committed by Mikhail I. Izmestev
parent b44d560685
commit 048becd504
3 changed files with 19 additions and 0 deletions

View File

@ -16,6 +16,7 @@ bool isDumpAnalyzing();
bool isKernelDebugging();
void debugGo();
void debugBreak();
// debug output
void dprint( const std::wstring &str, bool dml = false );

View File

@ -70,6 +70,9 @@ BOOST_PYTHON_MODULE( pykd )
python::def( "isKernelDebugging", &isKernelDebugging,
"Check if kernel dubugging is running" );
python::def( "breakin", &debugBreak,
"Break into debugger" );
python::def( "go", &debugGo,
"Go debugging" );

View File

@ -168,6 +168,21 @@ void debugGo()
} while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE );
}
/////////////////////////////////////////////////////////////////////////////////
void debugBreak()
{
PyThreadState *pystate = PyEval_SaveThread();
HRESULT hres;
hres = g_dbgEng->control->SetInterrupt( DEBUG_INTERRUPT_ACTIVE );
PyEval_RestoreThread( pystate );
if ( FAILED( hres ) )
throw DbgException( "IDebugControl::SetInterrupt" );
}
/////////////////////////////////////////////////////////////////////////////////