show_user_1 is only called from cli-cmds.c, so move it there and make
it static.
---
gdb/cli/cli-cmds.c | 35 +++++++++++++++++++++++++++++++++++
gdb/cli/cli-script.c | 35 -----------------------------------
gdb/cli/cli-script.h | 5 -----
3 files changed, 35 insertions(+), 40 deletions(-)
@@ -1643,6 +1643,41 @@ make_command (const char *arg, int from_tty)
}
}
+/* Print the definition of user command C to STREAM. Or, if C is a
+ prefix command, show the definitions of all user commands under C
+ (recursively). PREFIX and NAME combined are the name of the
+ current command. */
+static void
+show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
+ struct ui_file *stream)
+{
+ if (cli_user_command_p (c))
+ {
+ struct command_line *cmdlines = c->user_commands.get ();
+
+ gdb_printf (stream, "User %scommand \"",
+ c->is_prefix () ? "prefix" : "");
+ fprintf_styled (stream, title_style.style (), "%s%s",
+ prefix, name);
+ gdb_printf (stream, "\":\n");
+ if (cmdlines)
+ {
+ print_command_lines (current_uiout, cmdlines, 1);
+ gdb_puts ("\n", stream);
+ }
+ }
+
+ if (c->is_prefix ())
+ {
+ const std::string prefixname = c->prefixname ();
+
+ for (c = *c->subcommands; c != NULL; c = c->next)
+ if (c->theclass == class_user || c->is_prefix ())
+ show_user_1 (c, prefixname.c_str (), c->name, gdb_stdout);
+ }
+
+}
+
static void
show_user (const char *args, int from_tty)
{
@@ -1651,41 +1651,6 @@ script_from_file (FILE *stream, const char *file)
}
}
-/* Print the definition of user command C to STREAM. Or, if C is a
- prefix command, show the definitions of all user commands under C
- (recursively). PREFIX and NAME combined are the name of the
- current command. */
-void
-show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
- struct ui_file *stream)
-{
- if (cli_user_command_p (c))
- {
- struct command_line *cmdlines = c->user_commands.get ();
-
- gdb_printf (stream, "User %scommand \"",
- c->is_prefix () ? "prefix" : "");
- fprintf_styled (stream, title_style.style (), "%s%s",
- prefix, name);
- gdb_printf (stream, "\":\n");
- if (cmdlines)
- {
- print_command_lines (current_uiout, cmdlines, 1);
- gdb_puts ("\n", stream);
- }
- }
-
- if (c->is_prefix ())
- {
- const std::string prefixname = c->prefixname ();
-
- for (c = *c->subcommands; c != NULL; c = c->next)
- if (c->theclass == class_user || c->is_prefix ())
- show_user_1 (c, prefixname.c_str (), c->name, gdb_stdout);
- }
-
-}
-
void _initialize_cli_script ();
void
_initialize_cli_script ()
@@ -130,11 +130,6 @@ extern counted_command_line read_command_lines_1
extern void script_from_file (FILE *stream, const char *file);
-extern void show_user_1 (struct cmd_list_element *c,
- const char *prefix,
- const char *name,
- struct ui_file *stream);
-
/* Execute the commands in CMDLINES. */
extern void execute_control_commands (struct command_line *cmdlines,