]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
BUG 0020024: a --gdb-session option to runSalome ...
authorabd <abd@opencascade.com>
Thu, 30 Oct 2008 09:21:54 +0000 (09:21 +0000)
committerabd <abd@opencascade.com>
Thu, 30 Oct 2008 09:21:54 +0000 (09:21 +0000)
possibility for execution of xterm with gdb during salome starting.

bin/launchConfigureParser.py
bin/runSalome.py

index fc47cbe8927df0202583876b22ba6b221cf7f64e..10e57538fc7c401b28525111c5dd51580fd6af3b 100755 (executable)
@@ -53,6 +53,7 @@ pinter_nam     = "pinter"
 batch_nam      = "batch"
 test_nam       = "test"
 play_nam       = "play"
+gdb_session_nam = "gdb_session"
 
 # values in XML configuration file giving specific module parameters (<module_name> section)
 # which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
@@ -615,6 +616,14 @@ def CreateOptionParser (theAdditionalOptions=[]):
                              dest="play_script_file",
                              help=help_str)
 
+    # gdb session
+    help_str = "Launch session with gdb"
+    o_gdb = optparse.Option("--gdb-session",
+                            action="store_true",
+                            dest="gdb_session",
+                           default=False,
+                           help=help_str)
+                           
     # All options
     opt_list = [o_t,o_g, # GUI/Terminal
                 o_d,o_o, # Desktop
@@ -636,8 +645,8 @@ def CreateOptionParser (theAdditionalOptions=[]):
                 o_pi,    # Interactive python console
                 o_nspl,
                 o_test,  # Write/read test script file with help of TestRecorder
-                o_play]  # Reproducing test script with help of TestRecorder
-                
+                o_play,  # Reproducing test script with help of TestRecorder
+                o_gdb]
 
     #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources",
     #               "xterm", "modules", "embedded", "standalone",
@@ -916,6 +925,10 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"):
     # Interactive python console
     if cmd_opts.pinter is not None:
         args[pinter_nam] = cmd_opts.pinter
+       
+    # Gdb session in xterm
+    if cmd_opts.gdb_session is not None:
+        args[gdb_session_nam] = cmd_opts.gdb_session
 
     ####################################################
     # Add <theAdditionalOptions> values to args
index b468a468baf73b0c6695d4265ea92349793f94dd..1928dec9da1134847cfbfc54ded0feefdc4b6e24 100755 (executable)
@@ -313,6 +313,18 @@ class SessionServer(Server):
             self.CMD+=['-test'] + self.args['test']
         elif self.args.has_key('play'):
             self.CMD+=['-play'] + self.args['play']
+       
+       if self.args["gdb_session"]:
+            f = open(".gdbinit4salome", "w")
+            f.write("set args ")
+            args = " ".join(self.CMD[1:])
+            args = args.replace("(", "\(")
+            args = args.replace(")", "\)")
+            f.write(args)
+            f.write("\n")
+            f.close()
+            self.CMD += ["xterm", "-e", "gdb", "--command=.gdbinit4salome", self.CMD[0]]
+            pass
       
 # ---