Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com
To: gdb-patches@sourceware.org, eliz@gnu.org
Subject: [doc RFA] New option -nh
Date: Tue, 02 Oct 2012 17:46:00 -0000	[thread overview]
Message-ID: <yjt2sj9wbwd4.fsf@ruffy2.mtv.corp.google.com> (raw)

Hi.

This needs a doc RFA.

Previous discussion is here:
http://sourceware.org/ml/gdb-patches/2012-09/msg00415.html

2012-10-02  Doug Evans  <dje@google.com>

	New option -nh: inhibit loading of ~/.gdbinit.
	* NEWS: Mention -nh.
	* main.c (captured_main): Recognize and process -nh.
	(print_gdb_help): Mention -nh.

	doc/
	* gdb.texinfo (Mode Options): Document -nh.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.546
diff -u -p -r1.546 NEWS
--- NEWS	21 Sep 2012 01:46:42 -0000	1.546
+++ NEWS	2 Oct 2012 17:39:53 -0000
@@ -3,6 +3,10 @@
 
 *** Changes since GDB 7.5
 
+* New command line options:
+
+-nh     Like -nx, but only disable auto-loading of ~/.gdbinit.
+
 * Python scripting
 
   ** Vectors can be created with gdb.Type.vector.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.113
diff -u -p -r1.113 main.c
--- main.c	29 Aug 2012 19:17:16 -0000	1.113
+++ main.c	2 Oct 2012 17:39:53 -0000
@@ -273,6 +273,7 @@ captured_main (void *data)
   char **argv = context->argv;
   static int quiet = 0;
   static int set_args = 0;
+  static int inhibit_home_gdbinit = 0;
 
   /* Pointers to various arguments from command line.  */
   char *symarg = NULL;
@@ -415,6 +416,7 @@ captured_main (void *data)
       {"quiet", no_argument, &quiet, 1},
       {"q", no_argument, &quiet, 1},
       {"silent", no_argument, &quiet, 1},
+      {"nh", no_argument, &inhibit_home_gdbinit, 1},
       {"nx", no_argument, &inhibit_gdbinit, 1},
       {"n", no_argument, &inhibit_gdbinit, 1},
       {"batch-silent", no_argument, 0, 'B'},
@@ -845,7 +847,7 @@ captured_main (void *data)
      global parameters, which are independent of what file you are
      debugging or what directory you are in.  */
 
-  if (home_gdbinit && !inhibit_gdbinit)
+  if (home_gdbinit && !inhibit_gdbinit && !inhibit_home_gdbinit)
     catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL);
 
   /* Process '-ix' and '-iex' options early.  */
@@ -1066,9 +1068,12 @@ Options:\n\n\
   fputs_unfiltered (_("\
   -l TIMEOUT         Set timeout in seconds for remote debugging.\n\
   --nw		     Do not use a window interface.\n\
-  --nx               Do not read "), stream);
+  --nx               Do not read any "), stream);
   fputs_unfiltered (gdbinit, stream);
-  fputs_unfiltered (_(" file.\n\
+  fputs_unfiltered (_(" files.\n\
+  --nh               Do not read "), stream);
+  fputs_unfiltered (gdbinit, stream);
+  fputs_unfiltered (_(" file from home directory.\n\
   --quiet            Do not print version number on startup.\n\
   --readnow          Fully read symbol files on first access.\n\
 "), stream);
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.1012
diff -u -p -r1.1012 gdb.texinfo
--- doc/gdb.texinfo	21 Sep 2012 01:46:42 -0000	1.1012
+++ doc/gdb.texinfo	2 Oct 2012 17:39:53 -0000
@@ -1048,6 +1048,13 @@ Do not execute commands found in any ini
 options and arguments have been processed.  @xref{Command Files,,Command
 Files}.
 
+@anchor{-nh}
+@item -nh
+@cindex @code{--nh}
+Do not execute commands found in @file{~/.gdbinit}, the init file
+in your home directory.
+@xref{Startup}.
+
 @item -quiet
 @itemx -silent
 @itemx -q


             reply	other threads:[~2012-10-02 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 17:46 dje [this message]
2012-10-02 18:12 ` Eli Zaretskii
2012-10-02 20:54 ` Sergio Durigan Junior
2012-10-04 17:21   ` dje
2012-10-04 17:46     ` Eli Zaretskii
2012-10-05  6:55     ` Sergio Durigan Junior

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=yjt2sj9wbwd4.fsf@ruffy2.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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