aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-10-15 21:45:04 +0000
committerDoug Evans <dje@google.com>2012-10-15 21:45:04 +0000
commit07540c156d053380cda0aca5b137a7f5ef0e0e24 (patch)
treef634bfea9180c211e4ece0fec40da95a08aab8ca /gdb/main.c
parenteab09350a37d669c13aaccf621c9e22b7776a3be (diff)
downloadgdb-07540c156d053380cda0aca5b137a7f5ef0e0e24.zip
gdb-07540c156d053380cda0aca5b137a7f5ef0e0e24.tar.gz
gdb-07540c156d053380cda0aca5b137a7f5ef0e0e24.tar.bz2
New option -nh: inhibit loading of ~/.gdbinit.
* NEWS: Mention -nh. * main.c (captured_main): Recognize and process -nh. (print_gdb_help): Mention -nh. * gdb.1: Mention -nh. Remove erroneous docs on -nx behavior. doc/ * gdb.texinfo (Mode Options): Document -nh. Elaborate on docs for -nx.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 155b609..923a7fe 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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);