From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5476 invoked by alias); 17 Nov 2005 16:34:18 -0000 Received: (qmail 5464 invoked by uid 22791); 17 Nov 2005 16:34:16 -0000 Received: from fra-del-03.spheriq.net (HELO fra-del-03.spheriq.net) (195.46.51.99) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 17 Nov 2005 16:34:16 +0000 Received: from fra-out-01.spheriq.net (fra-out-01.spheriq.net [195.46.51.129]) by fra-del-03.spheriq.net with ESMTP id jAHGYAdJ012633 for ; Thu, 17 Nov 2005 16:34:10 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-01.spheriq.net with ESMTP id jAHGY0E1022366 for ; Thu, 17 Nov 2005 16:34:05 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id jAHGXsA6021574 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 17 Nov 2005 16:33:57 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F2387DA49; Thu, 17 Nov 2005 16:33:43 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 1AB7A4751A; Thu, 17 Nov 2005 16:36:43 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C1E7675994; Thu, 17 Nov 2005 16:36:42 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F30B247519; Thu, 17 Nov 2005 16:36:41 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CGZ46909 (AUTH "andrew stubbs"); Thu, 17 Nov 2005 16:33:41 GMT Message-ID: <437CB049.6060304@st.com> Date: Thu, 17 Nov 2005 19:20:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] -nx-except-gdbtkinit option References: <437B5ED3.70805@st.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020902030404070403080109" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00289.txt.bz2 This is a multi-part message in MIME format. --------------020902030404070403080109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 751 Eli Zaretskii wrote: > First, you didn't send a documentation patch. Apologies, I missed this. I have now added one. > Second, please tell more about the situations when this option could > be useful. The specific case I use it for is in a wrapper utility which calls gdb as follows (roughly): gdb -nx-except-gdbtkinit -d scriptdir -x globalscript \ -x ~/.gdbinit -x ./.gdbinit ..... The purpose is (among other things) to set up transparently (to the user) a selection of user-defined commands (for connecting and configuring target boards) which are available to users in the .gdbinit files. If -nx is used it has undesirable side effects when using Insight. I'm sure others can think of other purposes for it. Andrew Stubbs --------------020902030404070403080109 Content-Type: text/plain; name="nx-except-gdbtkinit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nx-except-gdbtkinit.patch" Content-length: 4254 2005-11-17 Andrew Stubbs * main.c (captured_main): Add option -nx-except-gdbtkinit and adjust -nx to support it. (print_gdb_help): Add --nx-except-gdbtkinit. * top.c (inhibit_gdbtkinit): New variable. * top.h (inhibit_gdbtkinit): New variable. doc/ * gdb.texinfo (Choosing modes): Add -nx-except-gdbtkinit option. gdbtk/ * generic/gdbtk.c (gdbtk_init): Change inhibit_gdbinit to inhibit_gdbtkinit. Index: src/gdb/main.c =================================================================== --- src.orig/gdb/main.c 2005-11-17 15:20:03.000000000 +0000 +++ src/gdb/main.c 2005-11-17 15:22:12.000000000 +0000 @@ -267,8 +267,8 @@ captured_main (void *data) {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, {"silent", no_argument, &quiet, 1}, - {"nx", no_argument, &inhibit_gdbinit, 1}, - {"n", no_argument, &inhibit_gdbinit, 1}, + {"nx", no_argument, 0, 'n'}, + {"n", no_argument, 0, 'n'}, {"batch-silent", no_argument, 0, 'B'}, {"batch", no_argument, &batch, 1}, {"epoch", no_argument, &epoch_interface, 1}, @@ -296,6 +296,7 @@ captured_main (void *data) {"x", required_argument, 0, 'x'}, {"ex", required_argument, 0, 'X'}, #ifdef GDBTK + {"nx-except-gdbtkinit", no_argument, &inhibit_gdbinit, 1}, {"tclcommand", required_argument, 0, 'z'}, {"enable-external-editor", no_argument, 0, 'y'}, {"editor-command", required_argument, 0, 'w'}, @@ -418,6 +419,10 @@ captured_main (void *data) batch = batch_silent = 1; gdb_stdout = ui_file_new(); break; + case 'n': + inhibit_gdbinit = 1; + inhibit_gdbtkinit = 1; + break; #ifdef GDBTK case 'z': { @@ -896,6 +901,8 @@ Options:\n\n\ --nx Do not read "), stream); fputs_unfiltered (gdbinit, stream); fputs_unfiltered (_(" file.\n\ + --nx-except-gdbtkinit\n\ + As for --nx, but do read gdbtkinit for insight.\n\ --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ "), stream); Index: src/gdb/top.c =================================================================== --- src.orig/gdb/top.c 2005-11-17 15:20:03.000000000 +0000 +++ src/gdb/top.c 2005-11-17 16:15:44.000000000 +0000 @@ -86,6 +86,7 @@ char gdbinit[PATH_MAX + 1] = GDBINIT_FILENAME; int inhibit_gdbinit = 0; +int inhibit_gdbtkinit = 0; /* If nonzero, and GDB has been configured to be able to use windows, attempt to open them upon startup. */ Index: src/gdb/top.h =================================================================== --- src.orig/gdb/top.h 2005-11-17 15:20:03.000000000 +0000 +++ src/gdb/top.h 2005-11-17 15:22:12.000000000 +0000 @@ -29,6 +29,7 @@ extern int linesize; extern FILE *instream; extern char gdb_dirbuf[1024]; extern int inhibit_gdbinit; +extern int inhibit_gdbtkinit; extern int epoch_interface; extern char gdbinit[]; Index: src/gdb/gdbtk/generic/gdbtk.c =================================================================== --- src.orig/gdb/gdbtk/generic/gdbtk.c 2005-11-17 15:20:03.000000000 +0000 +++ src/gdb/gdbtk/generic/gdbtk.c 2005-11-17 15:22:12.000000000 +0000 @@ -483,7 +483,7 @@ gdbtk_init (void) /* Set up some globals used by gdb to pass info to gdbtk for start up options and the like */ - xasprintf (&s, "%d", inhibit_gdbinit); + xasprintf (&s, "%d", inhibit_gdbtkinit); Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "inhibit_prefs", s, TCL_GLOBAL_ONLY); free(s); Index: src/gdb/doc/gdb.texinfo =================================================================== --- src.orig/gdb/doc/gdb.texinfo 2005-11-17 16:15:44.000000000 +0000 +++ src/gdb/doc/gdb.texinfo 2005-11-17 16:22:24.000000000 +0000 @@ -978,6 +978,12 @@ Do not execute commands found in any ini options and arguments have been processed. @xref{Command Files,,Command files}. +@item -nx-except-gdbtkinit +@kindex -nx-except-gdbtkinit +The same as @samp{-nx} with the difference that it does not prevent +Insight from loading the settings file @code{.gdbtkinit}. If you are not +using Insight then this option is exactly the same as @samp{-nx}. + @item -quiet @itemx -silent @itemx -q --------------020902030404070403080109--