mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 11:53:23 +08:00
[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:
parent
b44d560685
commit
048becd504
@ -16,6 +16,7 @@ bool isDumpAnalyzing();
|
||||
bool isKernelDebugging();
|
||||
|
||||
void debugGo();
|
||||
void debugBreak();
|
||||
|
||||
// debug output
|
||||
void dprint( const std::wstring &str, bool dml = false );
|
||||
|
@ -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" );
|
||||
|
||||
|
@ -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" );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user