From bbcba8e1d290ad6be2d7d2cba9d5342a6a0def0c Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 30 Aug 2005 07:51:57 +0000 Subject: [PATCH] Debug omniORB4 --- .../DataFlowExecutor_FiniteStateMachine.cxx | 27 ++++++++++++++++--- .../DataFlowExecutor_FiniteStateMachine.hxx | 14 +++++++++- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx index 0ed6762..f43eb79 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx @@ -229,7 +229,8 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { _ActionName[ Executing_StopAction ] = "Executing_StopAction" ; _ActionName[ Executing_SuccessAction ] = "Executing_SuccessAction" ; - _ActionName[ Executing_ErrorAction ] = "Executing_ErrorAction" ; +// _ActionName[ Executing_ErrorAction ] = "Executing_ErrorAction" ; + _ActionName[ Errored_ExecutingAction ] = "Errored_ExecutingAction" ; _ActionName[ Successed_SuccessAction ] = "Successed_SuccessAction" ; _ActionName[ Errored_ErrorAction ] = "Errored_ErrorAction" ; @@ -358,13 +359,16 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { //JR 24.03.2005 : Debug for PAL8176 : abort of GOTONode // ErrorEvent _TransitionTable[ SuccessedState ][ ErrorEvent ] = ErroredExecutingState ; - _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; +// _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; + _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Errored_ExecutingAction; // ErrorEvent _TransitionTable[ ExecutingState ][ ErrorEvent ] = ErroredExecutingState ; - _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; +// _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; + _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Errored_ExecutingAction; // SuspendedExecutingState : NO ResumeEvent 13-03-2003 _TransitionTable[ SuspendedExecutingState ][ ErrorEvent ] = ErroredExecutingState ; - _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; +// _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; + _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Errored_ExecutingAction; // DONE-CONTROL : // SuccessedExecutingState - SuccessEvent @@ -457,6 +461,10 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { perror( msg ) ; } +#if omniORB_4_0_5 + _SuperVisionComponent = SUPERV::SuperG::_nil() ; +#endif + pthread_mutex_init( &_MutexPythonWait , NULL ) ; _MutexPythonLocked = false ; _ExecNumber = 0 ; @@ -551,6 +559,7 @@ void GraphExecutor::FiniteStateMachine::PyLockReset() { } } +#define PyFunctionTrace 1 PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName ) { PyObject * RetVal = NULL ; @@ -558,6 +567,7 @@ PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncNa PyObject * PyFunctionMapped = _MapOfPyFunctions[ aPyFuncName ] ; if ( _GraphExecutingNumber > 1 && !PyObjRefIor ) { RetVal = PyFunctionMapped ; +#if PyFunctionTrace MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ) ; if ( RetVal ) { MESSAGE( RetVal << " ob_refcnt " << RetVal->ob_refcnt ) ; @@ -565,9 +575,11 @@ PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncNa else { MESSAGE( " NULL" ) ; } +#endif } else { RetVal = PyFunctionMapped ; +#if PyFunctionTrace MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ) ; if ( RetVal && PyObjRefIor ) { MESSAGE( RetVal << " " << RetVal->ob_refcnt ) ; @@ -578,6 +590,7 @@ PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncNa else { MESSAGE( " NULL" ) ; } +#endif } return RetVal ; @@ -587,15 +600,19 @@ bool GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName , P bool RetVal = false ; if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) { +#if PyFunctionTrace PyObject * aPyFunc = _MapOfPyFunctions[ aPyFuncName ] ; MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' , aPyFunction " << aPyFunction << " ) ob_refcnt " << aPyFunction->ob_refcnt << " already mapped : " << aPyFunc << " ob_refcnt " << aPyFunc->ob_refcnt ) ; +#endif } else { _MapOfPyFunctions[ aPyFuncName ] = aPyFunction ; +#if PyFunctionTrace MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) " << aPyFunction << " ) ob_refcnt " << aPyFunction->ob_refcnt << " mapped" ) ; +#endif RetVal = true ; } @@ -604,7 +621,9 @@ bool GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName , P bool GraphExecutor::FiniteStateMachine::ErasePyFunction( const char * aPyFuncName ) { +#if PyFunctionTrace MESSAGE( "GraphExecutor::FiniteStateMachine::ErasePyFunction( '" << aPyFuncName << "' )" ) ; +#endif if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) { _MapOfPyFunctions.erase( aPyFuncName ) ; return true ; diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx index d79e0e4..1bed34e 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx @@ -144,7 +144,8 @@ namespace GraphExecutor { Executing_KillAction , Executing_StopAction , Executing_SuccessAction , - Executing_ErrorAction , +// Executing_ErrorAction , + Errored_ExecutingAction , Successed_SuccessAction , Errored_ErrorAction , Successed_SuspendAction , @@ -175,6 +176,10 @@ namespace GraphExecutor { GraphExecutor::StateEventAction _ActionTable[ GraphExecutor::NumberOfAutomatonStates ] [ GraphExecutor::NumberOfEvents ] ; +#if omniORB_4_0_5 + SUPERV::SuperG_var _SuperVisionComponent ; +#endif + pthread_mutex_t _MutexPythonWait ; bool _MutexPythonLocked ; // Map between FuncName and corresponding Python Object Function @@ -200,6 +205,13 @@ namespace GraphExecutor { FiniteStateMachine() ; virtual ~FiniteStateMachine() {} ; +#if omniORB_4_0_5 + void SuperVisionComponent( SUPERV::SuperG_var mySuperVision ) { + _SuperVisionComponent = mySuperVision ; } ; + SUPERV::SuperG_var SuperVisionComponent() { + return _SuperVisionComponent ; } ; +#endif + int ExecNumber() ; void Executed() ; void PyInitModule(bool) ; -- 2.39.2