[~] viod -> void

[+] variable for PyThread_StateSave

git-svn-id: https://pykd.svn.codeplex.com/svn@69451 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2011-08-31 17:36:15 +00:00
parent f443f0cbe2
commit e4bbc369f9
5 changed files with 28 additions and 26 deletions

View File

@ -14,7 +14,7 @@ dbgBreakpointClass::breakpointMap dbgBreakpointClass::m_breakMap;
HRESULT dbgBreakpointClass::onBreakpointEvnet( IDebugBreakpoint* bp ) HRESULT dbgBreakpointClass::onBreakpointEvnet( IDebugBreakpoint* bp )
{ {
PyThread_StateSave( dbgExt->getThreadState() ); PyThread_StateSave pyThrdState( dbgExt->getThreadState() );
try { try {

View File

@ -69,7 +69,7 @@ HRESULT debugEvent::LoadModule(
dbgModuleClass module(moduleName, moduleBase, moduleSize); dbgModuleClass module(moduleName, moduleBase, moduleSize);
silentMode.reset(); silentMode.reset();
PyThread_StateSave( dbgExt->getThreadState() ); PyThread_StateSave pyThrdState( dbgExt->getThreadState() );
return onLoadModule( module ); return onLoadModule( module );
} }
@ -91,7 +91,7 @@ HRESULT debugEvent::UnloadModule(
dbgModuleClass module(moduleName, moduleBase, moduleSize); dbgModuleClass module(moduleName, moduleBase, moduleSize);
silentMode.reset(); silentMode.reset();
PyThread_StateSave( dbgExt->getThreadState() ); PyThread_StateSave pyThrdState( dbgExt->getThreadState() );
return onUnloadModule( module ); return onUnloadModule( module );
} }
@ -102,7 +102,7 @@ HRESULT debugEvent::SessionStatus(
__in ULONG Status __in ULONG Status
) )
{ {
PyThread_StateSave( dbgExt->getThreadState() ); PyThread_StateSave pyThrdState( dbgExt->getThreadState() );
return onChangeSessionStatus( Status ); return onChangeSessionStatus( Status );
} }
@ -114,7 +114,7 @@ HRESULT debugEvent::ChangeDebuggeeState(
__in ULONG64 Argument __in ULONG64 Argument
) )
{ {
PyThread_StateSave( dbgExt->getThreadState() ); PyThread_StateSave pyThrdState( dbgExt->getThreadState() );
return onChangeDebugeeState(); return onChangeDebugeeState();
} }

View File

@ -249,7 +249,7 @@ BOOST_PYTHON_MODULE( pykd )
DEF_PY_GLOBAL( "ulong_t", TypeInfo("", "unsigned long") ); DEF_PY_GLOBAL( "ulong_t", TypeInfo("", "unsigned long") );
DEF_PY_GLOBAL( "int_t", TypeInfo("", "int") ); DEF_PY_GLOBAL( "int_t", TypeInfo("", "int") );
DEF_PY_GLOBAL( "uint_t", TypeInfo("", "unsigned int") ); DEF_PY_GLOBAL( "uint_t", TypeInfo("", "unsigned int") );
DEF_PY_GLOBAL( "ptr_t", TypeInfo("", "viod*") ); DEF_PY_GLOBAL( "ptr_t", TypeInfo("", "void*") );
DEF_PY_GLOBAL( "double_t", TypeInfo("", "double") ); DEF_PY_GLOBAL( "double_t", TypeInfo("", "double") );
DEF_PY_GLOBAL( "longlong_t", TypeInfo("", "int64") ); DEF_PY_GLOBAL( "longlong_t", TypeInfo("", "int64") );
DEF_PY_GLOBAL( "ulonglong_t", TypeInfo("", "unsigned int64") ); DEF_PY_GLOBAL( "ulonglong_t", TypeInfo("", "unsigned int64") );
@ -703,9 +703,8 @@ DebugExtensionUninitialize()
} }
DbgExt::DbgExt( IDebugClient4 *masterClient ) DbgExt::DbgExt( IDebugClient4 *masterClient )
: m_threadState(NULL)
{ {
m_threadState = NULL;
client = NULL; client = NULL;
masterClient->QueryInterface( __uuidof(IDebugClient), (void **)&client ); masterClient->QueryInterface( __uuidof(IDebugClient), (void **)&client );

View File

@ -15,7 +15,9 @@ class PyThread_StateSave {
public: public:
PyThread_StateSave( PyThreadState **state ) { PyThread_StateSave( PyThreadState **state )
: m_state(NULL)
{
if ( *state != NULL ) if ( *state != NULL )
{ {
m_state = state; m_state = state;
@ -24,7 +26,8 @@ public:
} }
~PyThread_StateSave() { ~PyThread_StateSave() {
*m_state =PyEval_SaveThread(); if (m_state)
*m_state =PyEval_SaveThread();
} }
private: private: