From: abd Date: Wed, 29 Oct 2008 14:45:43 +0000 (+0000) Subject: BUG 0020024: a --gdb-session option to runSalome ... X-Git-Tag: V4_1_4rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0636a086b57942934bb914f86f22f098d0d5695f;p=modules%2Fkernel.git BUG 0020024: a --gdb-session option to runSalome ... possibility for execution of xterm with gdb during salome starting. --- diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 74b3cd0a1..65b10def1 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -51,6 +51,7 @@ except_nam = "noexcepthandler" terminal_nam = "terminal" pinter_nam = "pinter" batch_nam = "batch" +gdb_session_nam = "gdb_session" # values in XML configuration file giving specific module parameters ( section) # which are stored in opts with key _ (eg SMESH_plugins) @@ -595,6 +596,13 @@ def CreateOptionParser (theAdditionalOptions=[]): dest="ns_port_log_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 @@ -614,7 +622,9 @@ def CreateOptionParser (theAdditionalOptions=[]): o_a, # Print free port and exit o_n, # --nosave-config o_pi, # Interactive python console - o_nspl] + o_nspl, + o_gdb, + ] #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources", @@ -895,6 +905,10 @@ def get_env(theAdditionalOptions=[], appname="SalomeApp"): if cmd_opts.pinter is not None: args[pinter_nam] = cmd_opts.pinter + # Interactive python console + if cmd_opts.gdb_session is not None: + args[gdb_session_nam] = cmd_opts.gdb_session + #################################################### # Add values to args for add_opt in theAdditionalOptions: diff --git a/bin/runSalome.py b/bin/runSalome.py index 334f5bafb..780e77a77 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -309,7 +309,18 @@ class SessionServer(Server): self.CMD=self.SCMD1 + ['\"' + string.join(cata_path,'\"::\"') + '\"'] + self.SCMD2 else: self.CMD=self.SCMD1 + self.SCMD2 - + 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 + # --- class LauncherServer(Server):