Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] -nx-except-gdbtkinit option
Date: Wed, 16 Nov 2005 17:34:00 -0000	[thread overview]
Message-ID: <437B5ED3.70805@st.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

Hi,

The attached patch adds a new option named '-nx-except-gdbtkinit'. Not 
exactly a snappy name, but it does what it says on the tin and I only 
intend it for use with a wrapper script we use. I can add a shorter name 
if required.

The -nx option disables .gdbinit but also disables .gdbtkinit, which is 
not what I desire. The -nx-except-gdbtkinit does the same as -nx, but 
without affecting the configuration of Insight.

Andrew Stubbs

[-- Attachment #2: nx-except-gdbtkinit.patch --]
[-- Type: text/plain, Size: 3491 bytes --]

2005-11-16  Andrew Stubbs  <andrew.stubbs@st.com>

	* 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.

gdbtk/
	* generic/gdbtk.c (gdbtk_init): Change inhibit_gdbinit to
	inhibit_gdbtkinit.

Index: src/gdb/main.c
===================================================================
--- src.orig/gdb/main.c	2005-11-08 12:39:37.000000000 +0000
+++ src/gdb/main.c	2005-11-08 14:16:37.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-08 12:39:37.000000000 +0000
+++ src/gdb/top.c	2005-11-08 14:16:37.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-08 12:39:37.000000000 +0000
+++ src/gdb/top.h	2005-11-08 14:16:37.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-08 12:39:37.000000000 +0000
+++ src/gdb/gdbtk/generic/gdbtk.c	2005-11-08 14:16:37.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);
    

             reply	other threads:[~2005-11-16 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16 17:34 Andrew STUBBS [this message]
2005-11-16 22:43 ` Eli Zaretskii
2005-11-17 19:20   ` Andrew STUBBS
2005-11-17 19:49     ` Eli Zaretskii
2005-11-17 23:44       ` Daniel Jacobowitz
2005-11-18  2:52         ` Andrew STUBBS
2005-11-18 12:33         ` Andrew STUBBS
2005-11-18 12:50           ` Eli Zaretskii
2005-11-18 12:59             ` Andrew STUBBS
2005-11-18 16:33               ` Daniel Jacobowitz
2005-11-30  1:38                 ` Andrew STUBBS
2005-11-18  0:08       ` Andrew STUBBS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=437B5ED3.70805@st.com \
    --to=andrew.stubbs@st.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox