From bada66218c9794d5f8b80be753ef414cc32cd29b Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 15 Feb 2005 14:11:31 +0000 Subject: [PATCH] Test of SIGSEGV --- src/SIGNALSComponent/Makefile.in | 60 +++++++++++ src/SIGNALSComponent/SIGNALSComponent.cxx | 101 ++++++++++++++++++ src/SIGNALSComponent/SIGNALSComponent.hxx | 67 ++++++++++++ src/SIGNALSComponent_Swig/Makefile.in | 58 ++++++++++ .../libSIGNALSComponent_Swig.i | 39 +++++++ 5 files changed, 325 insertions(+) create mode 100755 src/SIGNALSComponent/Makefile.in create mode 100755 src/SIGNALSComponent/SIGNALSComponent.cxx create mode 100755 src/SIGNALSComponent/SIGNALSComponent.hxx create mode 100644 src/SIGNALSComponent_Swig/Makefile.in create mode 100644 src/SIGNALSComponent_Swig/libSIGNALSComponent_Swig.i diff --git a/src/SIGNALSComponent/Makefile.in b/src/SIGNALSComponent/Makefile.in new file mode 100755 index 0000000..64d4287 --- /dev/null +++ b/src/SIGNALSComponent/Makefile.in @@ -0,0 +1,60 @@ +# SuperVisionTest SIGNALSComponent : example of component that devides two numbers +# +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.in +# Author : , CEA +# Module : SuperVisionTest +# $Header: + +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/idl + + +@COMMENCE@ + +EXPORT_HEADERS = \ + SIGNALSComponent.hxx + +# Libraries targets +LIB = libSIGNALSComponentEngine.la +LIB_SRC = \ + SIGNALSComponent.cxx + +LIB_SERVER_IDL = SALOME_Component.idl \ + SIGNALSComponent.idl + +# Executables targets +BIN = +BIN_SRC = +BIN_SERVER_IDL = + +CPPFLAGS+= $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome +#CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ $(PYTHON_INCLUDES) -ftemplate-depth-42 -Wno-deprecated +CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ $(PYTHON_INCLUDES) -ftemplate-depth-42 -Wall -I${KERNEL_ROOT_DIR}/include/salome +LDFLAGS+= -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -L${KERNEL_ROOT_DIR}/lib/salome + + +@CONCLUDE@ + diff --git a/src/SIGNALSComponent/SIGNALSComponent.cxx b/src/SIGNALSComponent/SIGNALSComponent.cxx new file mode 100755 index 0000000..0da7521 --- /dev/null +++ b/src/SIGNALSComponent/SIGNALSComponent.cxx @@ -0,0 +1,101 @@ +// SuperVisionTest SIGNALSComponent : example of component that devides two numbers +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SIGNALSComponentEngine.cxx +// Author : MARC TAJCHMAN, CEA +// Module : SuperVisionTest + +using namespace std; +#include +#include +#include +#include +#include + +//#include "utilities.h" +#include "SIGNALSComponent.hxx" + +SIGNALSComponentEngine::SIGNALSComponentEngine( CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) : + Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) +{ + MESSAGE("SIGNALSComponentEngine::SIGNALSComponentEngine activate object instanceName(" + << instanceName << ") interfaceName(" << interfaceName << ")" ) + _thisObj = this ; + _id = _poa->activate_object(_thisObj); + NULLPTR = NULL ; +} + +SIGNALSComponentEngine::SIGNALSComponentEngine() : + Engines_Component_i() +{ + NULLPTR = NULL ; +} + +SIGNALSComponentEngine::~SIGNALSComponentEngine() +{ +} + +long SIGNALSComponentEngine::SIGSEGVfunc() { + beginService( " SIGNALSComponentEngine::SIGSEGVfunc" ); + int S = 10 ; + while ( S ) { + S = sleep( S ) ; + } + long nullptr = *NULLPTR ; + endService( " SIGNALSComponentEngine::SIGSEGVfunc" ); + return nullptr ; +} + +long SIGNALSComponentEngine::SIGFPEfunc( long a , long b ) { + beginService( " SIGNALSComponentEngine::SIGFPEfunc" ); + int S = 10 ; + while ( S ) { + S = sleep( S ) ; + } + long c = a/b ; + endService( " SIGNALSComponentEngine::SIGFPEfunc" ); + return c ; +} + +extern "C" +{ + PortableServer::ObjectId * SIGNALSComponentEngine_factory + (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) + { + MESSAGE("SIGNALSComponentEngine_factory SIGNALSComponentEngine (" + << instanceName << "," << interfaceName << ")"); + SIGNALSComponentEngine * mySIGNALSComponent + = new SIGNALSComponentEngine(orb, poa, contId, instanceName, interfaceName); + return mySIGNALSComponent->getId() ; + } +} + + diff --git a/src/SIGNALSComponent/SIGNALSComponent.hxx b/src/SIGNALSComponent/SIGNALSComponent.hxx new file mode 100755 index 0000000..8de056c --- /dev/null +++ b/src/SIGNALSComponent/SIGNALSComponent.hxx @@ -0,0 +1,67 @@ +// SuperVisionTest SIGNALSComponent : example of component that devides two numbers +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SIGNALSComponentEngine.hxx +// Author : MARC TAJCHMAN, CEA +// Module : SuperVisionTest +// $Header$ + +#ifndef _SIGNALSCOMPONENTENGINE_HXX_ +#define _SIGNALSCOMPONENTENGINE_HXX_ + +//#include +#include +#include CORBA_SERVER_HEADER(SIGNALSComponent) +#include CORBA_SERVER_HEADER(SALOME_Component) +#include "SALOME_Component_i.hxx" + +class SIGNALSComponentEngine : public POA_SuperVisionTest::SIGNALSComponent , + public Engines_Component_i { +public: + SIGNALSComponentEngine() ; + SIGNALSComponentEngine( CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName); + + virtual ~SIGNALSComponentEngine(); + + long SIGSEGVfunc() ; + long SIGFPEfunc( long a , long b ) ; + +private: + + long * NULLPTR ; + +}; + +extern "C" + PortableServer::ObjectId * SIGNALSComponentEngine_factory + ( CORBA::ORB_ptr orb , + PortableServer::POA_ptr poa , + PortableServer::ObjectId * contId , + const char *instanceName , + const char *interfaceName ) ; + +#endif diff --git a/src/SIGNALSComponent_Swig/Makefile.in b/src/SIGNALSComponent_Swig/Makefile.in new file mode 100644 index 0000000..509a389 --- /dev/null +++ b/src/SIGNALSComponent_Swig/Makefile.in @@ -0,0 +1,58 @@ +# SuperVisionTest SIGNALSComponent : example of component that devides two numbers +# +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.in +# Author : , CEA +# Module : SuperVisionTest +# $Header: + +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/idl + + +@COMMENCE@ + + +# Libraries targets +LIB = libSIGNALSComponent_Swigcmodule.la + +SWIG_DEF = libSIGNALSComponent_Swig.i +EXPORT_PYSCRIPTS = libSIGNALSComponent_Swig.py + +LIB_SERVER_IDL = + +# Executables targets +BIN = +BIN_SRC = +BIN_SERVER_IDL = + +CPPFLAGS+= $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome +#CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ $(PYTHON_INCLUDES) -ftemplate-depth-42 -Wno-deprecated +CXXFLAGS= -g -D_DEBUG_ -D__x86__ -D__linux__ $(PYTHON_INCLUDES) -ftemplate-depth-42 -Wall -I${KERNEL_ROOT_DIR}/include/salome +LDFLAGS+= -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -L${KERNEL_ROOT_DIR}/lib/salome -lSIGNALSComponentEngine + + +@CONCLUDE@ + diff --git a/src/SIGNALSComponent_Swig/libSIGNALSComponent_Swig.i b/src/SIGNALSComponent_Swig/libSIGNALSComponent_Swig.i new file mode 100644 index 0000000..2406947 --- /dev/null +++ b/src/SIGNALSComponent_Swig/libSIGNALSComponent_Swig.i @@ -0,0 +1,39 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : libSIGNALSComponent_Swig.i +// Author : Jean Rahuel +// Module : EXAMPLES +// $Header: + +%module libSIGNALSComponent_Swig +%{ +#include "SIGNALSComponent.hxx" +%} + +class SIGNALSComponentEngine { +public: + SIGNALSComponentEngine(){}; + long SIGSEGVfunc() ; + long SIGFPEfunc( long a , long b ) ; +}; + + -- 2.39.2