aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-07-11 08:54:17 -0600
committerTom Tromey <tromey@adacore.com>2019-07-11 10:28:27 -0600
commitb777eb6de24ae1a1dc2f1e48d593b0a5c79937a9 (patch)
tree7b5a07c166d0453709cd5190c3adf5b753da8db4 /gdb/main.c
parent72ee03ff58d954dbed886b672032c8c9db0a0dcc (diff)
downloadgdb-b777eb6de24ae1a1dc2f1e48d593b0a5c79937a9.zip
gdb-b777eb6de24ae1a1dc2f1e48d593b0a5c79937a9.tar.gz
gdb-b777eb6de24ae1a1dc2f1e48d593b0a5c79937a9.tar.bz2
Remove init_cli_cmds
I noticed that init_cli_cmds only installs a command, and so doesn't need to be handled specially. This patch merges it into _initialize_cli_cmds. The help text is constructed dynamically, which is sometimes an indication that special treatment is needed; but in this case it is just to insert the value of "gdbinit", which is created at compile-time and not modified; so this doesn't affect the result. This version also removes the "gdbinit" global. There's no need for it, as GDBINIT can be used instead. Note, though, that the help text in question must still be dynamically constructed, in order to be i18n-friendly. gdb/ChangeLog 2019-07-11 Tom Tromey <tromey@adacore.com> * main.c (get_init_files): Use GDBINIT, not gdbinit. * auto-load.c (file_is_auto_load_safe): Use GDBINIT, not gdbinit. * top.h (gdbinit): Don't declare. * cli/cli-cmds.c (init_cli_cmds): Remove, merging contents into... (_initialize_cli_cmds): ...here. Use GDBINIT, not gdbinit. * top.c (gdb_init): Don't call init_cli_cmds. (gdbinit): Remove. * cli/cli-cmds.h (init_cli_cmds): Don't declare.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 540738e..678c413 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -260,7 +260,7 @@ get_init_files (const char **system_gdbinit,
if (homedir)
{
- homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
+ homeinit = xstrprintf ("%s/%s", homedir, GDBINIT);
if (stat (homeinit, &homebuf) != 0)
{
xfree (homeinit);
@@ -268,12 +268,12 @@ get_init_files (const char **system_gdbinit,
}
}
- if (stat (gdbinit, &cwdbuf) == 0)
+ if (stat (GDBINIT, &cwdbuf) == 0)
{
if (!homeinit
|| memcmp ((char *) &homebuf, (char *) &cwdbuf,
sizeof (struct stat)))
- localinit = gdbinit;
+ localinit = GDBINIT;
}
initialized = 1;