]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: Debug Unit tests BR_V4dev_resman
authorprascle <prascle>
Tue, 23 Oct 2007 08:59:04 +0000 (08:59 +0000)
committerprascle <prascle>
Tue, 23 Oct 2007 08:59:04 +0000 (08:59 +0000)
src/Launcher/SALOME_LauncherServer.cxx
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/ResourcesManager/SALOME_ResourcesManager.hxx

index 855b967e90c5af95f10ed1991b4f84f469da2835..a08feccb608963eb9e61ad04202c8ca781251ebb 100644 (file)
 //
 #include "SALOME_Launcher.hxx"
 #include "utilities.h"
+#include <sstream>
+#include <iostream>
+#include <stdexcept>
+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;
index 37d6bf2c04a824ae3ab1bb986a98fa00cb4137c6..ca00a90be7849d72e9211315647bc4e0ae31d1d3 100644 (file)
@@ -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 <std::string> vec;
index f4bd9d076a9168bbd95ff312436637e68824cfa6..94946cfd7aed7c39e620671d6ddc492a3a3ca896 100644 (file)
@@ -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);