aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
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/cli
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/cli')
-rw-r--r--gdb/cli/cli-cmds.c11
-rw-r--r--gdb/cli/cli-cmds.h2
2 files changed, 2 insertions, 11 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index e689c0f..0b62622 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -2215,15 +2215,8 @@ Make \"spe\" an alias of \"set print elements\":\n\
alias spe = set print elements\n\
Make \"elms\" an alias of \"elements\" in the \"set print\" command:\n\
alias -a set print elms = set print elements"));
-}
-
-void
-init_cli_cmds (void)
-{
- struct cmd_list_element *c;
- char *source_help_text;
- source_help_text = xstrprintf (_("\
+ const char *source_help_text = xstrprintf (_("\
Read commands from a file named FILE.\n\
\n\
Usage: source [-s] [-v] FILE\n\
@@ -2232,7 +2225,7 @@ Usage: source [-s] [-v] FILE\n\
-v: each command in FILE is echoed as it is executed.\n\
\n\
Note that the file \"%s\" is read automatically in this way\n\
-when GDB is started."), gdbinit);
+when GDB is started."), GDBINIT);
c = add_cmd ("source", class_support, source_command,
source_help_text, &cmdlist);
set_cmd_completer (c, filename_completer);
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index ac0591e..5bfffde 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -105,8 +105,6 @@ extern struct cmd_list_element *showchecklist;
void init_cmd_lists (void);
-void init_cli_cmds (void);
-
int is_complete_command (struct cmd_list_element *cmd);
/* Exported to gdb/main.c */