]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
add --valgrind-session to runSalome
authoradam <adam>
Tue, 6 Jul 2010 10:32:37 +0000 (10:32 +0000)
committeradam <adam>
Tue, 6 Jul 2010 10:32:37 +0000 (10:32 +0000)
bin/launchConfigureParser.py
bin/runSalome.py

index 7fde55b7987e62405bc5e53ba2e90fc8a0c68432..b807edad5bd7b83177e79d667b6d9c1ca4779b00 100755 (executable)
@@ -59,6 +59,7 @@ test_nam       = "test"
 play_nam       = "play"
 gdb_session_nam = "gdb_session"
 ddd_session_nam = "ddd_session"
+valgrind_session_nam = "valgrind_session"
 shutdown_servers_nam = "shutdown_servers"
 
 # values in XML configuration file giving specific module parameters (<module_name> section)
@@ -638,6 +639,14 @@ def CreateOptionParser (theAdditionalOptions=[]):
                             dest="ddd_session", default=False,
                             help=help_str)
     
+
+    # valgrind session
+    help_str = "Launch session with valgrind $VALGRIND_OPTIONS"
+    o_valgrind = optparse.Option("--valgrind-session",
+                                 action="store_true",
+                                 dest="valgrind_session", default=False,
+                                 help=help_str)
+
     # shutdown-servers. Default: False.
     help_str  = "1 to shutdown standalone servers when leaving python interpreter, "
     help_str += "0 to keep the standalone servers as daemon [default]. "
@@ -675,6 +684,7 @@ def CreateOptionParser (theAdditionalOptions=[]):
                 o_play,  # Reproducing test script with help of TestRecorder
                 o_gdb,
                 o_ddd,
+                o_valgrind,
                 o_shutdown,
                 ]
 
@@ -969,6 +979,10 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"):
     if cmd_opts.ddd_session is not None:
         args[ddd_session_nam] = cmd_opts.ddd_session
 
+    # valgrind session
+    if cmd_opts.valgrind_session is not None:
+        args[valgrind_session_nam] = cmd_opts.valgrind_session
+
     # Shutdown servers
     if cmd_opts.shutdown_servers is None:
         args[shutdown_servers_nam] = 0
index d03a67d6e4e5d55b5e07603e25d6d5f6757a3783..f0bed272df32f28adae255cb20f2878eb84c4e31 100755 (executable)
@@ -323,6 +323,15 @@ class SessionServer(Server):
                 pass
             pass
         
+        if self.args["valgrind_session"]:
+            l = ["valgrind"]
+            val = os.getenv("VALGRIND_OPTIONS")
+            if val:
+                l += val.split()
+                pass
+            self.CMD = l + self.CMD
+            pass
+        
 # ---
 
 class LauncherServer(Server):