From b31456877d33301aca4194204ecb1a27f52f0ba6 Mon Sep 17 00:00:00 2001 From: "SND\\EreTIk_cp" Date: Mon, 2 Sep 2013 16:14:14 +0000 Subject: [PATCH] [2.0.x] + DEBUG_ENGOPT_INITIAL_BREAK for attachKernel git-svn-id: https://pykd.svn.codeplex.com/svn@85045 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/win/dbgps.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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());