[0.2.x] fixed : issue #11643 ( setBp does not work in standalone script ( out of windbg ) )

git-svn-id: https://pykd.svn.codeplex.com/svn@83040 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-03-21 15:51:49 +00:00 committed by Mikhail I. Izmestev
parent b7c23b4aa3
commit 429c7fd8a9
2 changed files with 38 additions and 12 deletions

View File

@ -6,6 +6,7 @@
#include "win/dbgeng.h" #include "win/dbgeng.h"
#include "win/dbgio.h" #include "win/dbgio.h"
#include "dbgexcept.h" #include "dbgexcept.h"
#include "eventhandler.h"
namespace pykd { namespace pykd {
@ -1542,6 +1543,32 @@ HRESULT STDMETHODCALLTYPE DebugEngine::ChangeEngineState(
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
DebugEngine::DbgEngBind* DebugEngine::operator->()
{
if ( m_bind.get() != NULL )
return m_bind.get();
CComPtr<IDebugClient4> client = NULL;
HRESULT hres = DebugCreate( __uuidof(IDebugClient4), (void **)&client );
if ( FAILED( hres ) )
throw DbgException("DebugCreate failed");
m_bind.reset(new DbgEngBind(client, this) );
python::object main = boost::python::import("__main__");
python::object main_namespace = main.attr("__dict__");
python::object pykd = boost::python::import( "pykd" );
main_namespace["globalEventHandler"] = EventHandlerPtr( new EventHandlerImpl() );
return m_bind.get();
}
///////////////////////////////////////////////////////////////////////////////
ULONG64 ULONG64
getCurrentProcess() getCurrentProcess()
{ {

View File

@ -84,22 +84,21 @@ public:
__in ULONG Flags, __in ULONG Flags,
__in ULONG64 Argument ); __in ULONG64 Argument );
DbgEngBind* DbgEngBind* operator->();
operator->() //{
{ // if ( m_bind.get() != NULL )
if ( m_bind.get() != NULL ) // return m_bind.get();
return m_bind.get();
CComPtr<IDebugClient4> client = NULL; // CComPtr<IDebugClient4> client = NULL;
HRESULT hres = DebugCreate( __uuidof(IDebugClient4), (void **)&client ); // HRESULT hres = DebugCreate( __uuidof(IDebugClient4), (void **)&client );
if ( FAILED( hres ) ) // if ( FAILED( hres ) )
throw DbgException("DebugCreate failed"); // throw DbgException("DebugCreate failed");
m_bind.reset(new DbgEngBind(client, this) ); // m_bind.reset(new DbgEngBind(client, this) );
return m_bind.get(); // return m_bind.get();
} //}
void registerCallbacks( const DEBUG_EVENT_CALLBACK *callbacks ); void registerCallbacks( const DEBUG_EVENT_CALLBACK *callbacks );
void removeCallbacks( const DEBUG_EVENT_CALLBACK *callbacks ); void removeCallbacks( const DEBUG_EVENT_CALLBACK *callbacks );