aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-12-18 19:23:33 +0000
committerTom Tromey <tromey@redhat.com>2012-12-18 19:23:33 +0000
commit43e4916ffe6295e4240921985e67b6bdf0562137 (patch)
tree4e058185f4eee8b05202aad0c7dd6268208433c8 /gdb/cli
parentc9630d9c13232b1d3316def15ae2cae6aac25263 (diff)
downloadgdb-43e4916ffe6295e4240921985e67b6bdf0562137.zip
gdb-43e4916ffe6295e4240921985e67b6bdf0562137.tar.gz
gdb-43e4916ffe6295e4240921985e67b6bdf0562137.tar.bz2
* cli/cli-cmds.c (_initialize_cli_cmds): New function.
(init_cli_cmds): Move most code into new function.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index b65262e..6ee3e3c 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1643,11 +1643,13 @@ show_max_user_call_depth (struct ui_file *file, int from_tty,
}
+
+initialize_file_ftype _initialize_cli_cmds;
+
void
-init_cli_cmds (void)
+_initialize_cli_cmds (void)
{
struct cmd_list_element *c;
- char *source_help_text;
/* Define the classes of commands.
They will appear in the help list in alphabetical order. */
@@ -1714,20 +1716,6 @@ End with a line of just \"end\".\n\
Use the \"document\" command to give documentation for the new command.\n\
Commands defined in this way may have up to ten arguments."));
- source_help_text = xstrprintf (_("\
-Read commands from a file named FILE.\n\
-\n\
-Usage: source [-s] [-v] FILE\n\
--s: search for the script in the source search path,\n\
- even if FILE contains directories.\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);
- c = add_cmd ("source", class_support, source_command,
- source_help_text, &cmdlist);
- set_cmd_completer (c, filename_completer);
-
add_setshow_enum_cmd ("script-extension", class_support,
script_ext_enums, &script_ext_mode, _("\
Set mode for script filename extension recognition."), _("\
@@ -1939,3 +1927,24 @@ Make \"spe\" an alias of \"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 (_("\
+Read commands from a file named FILE.\n\
+\n\
+Usage: source [-s] [-v] FILE\n\
+-s: search for the script in the source search path,\n\
+ even if FILE contains directories.\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);
+ c = add_cmd ("source", class_support, source_command,
+ source_help_text, &cmdlist);
+ set_cmd_completer (c, filename_completer);
+}