diff --git a/pykd/win/dbgps.cpp b/pykd/win/dbgps.cpp index 5aa5517..474f5d7 100644 --- a/pykd/win/dbgps.cpp +++ b/pykd/win/dbgps.cpp @@ -88,7 +88,17 @@ void attachKernel( const std::string &connectOptions ) { PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate ); - HRESULT hres = + ULONG opt; + HRESULT hres = g_dbgEng->control->GetEngineOptions( &opt ); + if ( FAILED( hres ) ) + throw DbgException( "IDebugControl::GetEngineOptions", hres ); + + opt |= DEBUG_ENGOPT_INITIAL_BREAK; + hres = g_dbgEng->control->SetEngineOptions( opt ); + if ( FAILED( hres ) ) + throw DbgException( "IDebugControl::SetEngineOptions", hres ); + + hres = g_dbgEng->client->AttachKernel( connectOptions.empty() ? DEBUG_ATTACH_LOCAL_KERNEL : DEBUG_ATTACH_KERNEL_CONNECTION, connectOptions.empty() ? NULL : connectOptions.c_str());