From: prascle Date: Tue, 23 Oct 2007 08:59:04 +0000 (+0000) Subject: PR: Debug Unit tests X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5002ae95d9f6360b3c30017ac2dce9f66580b129;p=modules%2Fkernel.git PR: Debug Unit tests --- diff --git a/src/Launcher/SALOME_LauncherServer.cxx b/src/Launcher/SALOME_LauncherServer.cxx index 855b967e9..a08feccb6 100644 --- a/src/Launcher/SALOME_LauncherServer.cxx +++ b/src/Launcher/SALOME_LauncherServer.cxx @@ -19,9 +19,44 @@ // #include "SALOME_Launcher.hxx" #include "utilities.h" +#include +#include +#include +using namespace std; + +void AttachDebugger() +{ + if(getenv ("DEBUGGER")) + { + std::stringstream exec; + exec << "$DEBUGGER SALOME_LauncherServer " << getpid() << "&"; + std::cerr << exec.str() << std::endl; + system(exec.str().c_str()); + while(1); + } +} + +void terminateHandler(void) +{ + std::cerr << "Terminate: not managed exception !" << std::endl; + AttachDebugger(); +} + +void unexpectedHandler(void) +{ + std::cerr << "Unexpected: unexpected exception !" << std::endl; + AttachDebugger(); +} + int main(int argc, char* argv[]) { + if(getenv ("DEBUGGER")) + { +// setsig(SIGSEGV,&Handler); + set_terminate(&terminateHandler); + set_unexpected(&unexpectedHandler); + } PortableServer::POA_var root_poa; PortableServer::POAManager_var pman; CORBA::Object_var obj; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 37d6bf2c0..ca00a90be 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -164,7 +164,7 @@ void SALOME_ResourcesManager::Shutdown() Engines::MachineList * SALOME_ResourcesManager::GetFittingResources(const Engines::MachineParameters& params, const Engines::CompoList& componentList) -throw(SALOME_Exception) +//throw(SALOME_Exception) { // MESSAGE("ResourcesManager::GetFittingResources"); vector vec; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index f4bd9d076..94946cfd7 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -65,8 +65,8 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager: Engines::MachineList * GetFittingResources(const Engines::MachineParameters& params, - const Engines::CompoList& componentList) - throw(SALOME_Exception); + const Engines::CompoList& componentList); +// throw(SALOME_Exception); char* FindFirst(const Engines::MachineList& listOfMachines); std::string FindNext(const Engines::MachineList& listOfMachines);