aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:36:44 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit0426ad513f93bb1c5805988e60d6f87fbe738860 (patch)
tree6ad0f94f9b2a907623df38db9dd7727fe80f5d51 /gdb/cli
parent19a7b8ab871b92dee32a0ebffe274388d3426564 (diff)
downloadgdb-0426ad513f93bb1c5805988e60d6f87fbe738860.zip
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.gz
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.bz2
Unify gdb puts functions
Now that filtered and unfiltered output can be treated identically, we can unify the puts family of functions. This is done under the name "gdb_puts". Most of this patch was written by script.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c40
-rw-r--r--gdb/cli/cli-dump.c2
-rw-r--r--gdb/cli/cli-script.c4
-rw-r--r--gdb/cli/cli-style.c2
4 files changed, 24 insertions, 24 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 3c21c6e..0233401 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1355,7 +1355,7 @@ fput_alias_definition_styled (const cmd_list_element &c,
struct ui_file *stream)
{
gdb_assert (c.is_alias ());
- fputs_filtered (" alias ", stream);
+ gdb_puts (" alias ", stream);
fput_command_name_styled (c, stream);
fprintf_filtered (stream, " = ");
fput_command_name_styled (*c.alias_target, stream);
@@ -1413,13 +1413,13 @@ fput_command_names_styled (const cmd_list_element &c,
if (!print_alias (alias))
continue;
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
stream->wrap_here (3);
fput_command_name_styled (alias, stream);
}
if (print_something)
- fputs_filtered (postfix, stream);
+ gdb_puts (postfix, stream);
}
/* If VERBOSE, print the full help for command C and highlight the
@@ -1435,21 +1435,21 @@ print_doc_of_command (const cmd_list_element &c, const char *prefix,
this documentation from the previous command help, in the likely
case that apropos finds several commands. */
if (verbose)
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
fput_command_names_styled (c, true,
verbose ? "" : " -- ", stream);
if (verbose)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
fput_aliases_definition_styled (c, stream);
fputs_highlighted (c.doc, highlight, stream);
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
}
else
{
print_doc_line (stream, c.doc, false);
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
fput_aliases_definition_styled (c, stream);
}
}
@@ -1573,8 +1573,8 @@ help_cmd (const char *command, struct ui_file *stream)
the false indicates to not output the (single) command name. */
fput_command_names_styled (*c, false, "\n", stream);
fput_aliases_definition_styled (*c, stream);
- fputs_filtered (c->doc, stream);
- fputs_filtered ("\n", stream);
+ gdb_puts (c->doc, stream);
+ gdb_puts ("\n", stream);
if (!c->is_prefix () && !c->is_command_class_help ())
return;
@@ -1661,18 +1661,18 @@ Type \"help all\" for the list of all commands.");
fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",
cmdtype1, cmdtype2);
stream->wrap_here (0);
- fputs_filtered ("for ", stream);
+ gdb_puts ("for ", stream);
stream->wrap_here (0);
- fputs_filtered ("full ", stream);
+ gdb_puts ("full ", stream);
stream->wrap_here (0);
- fputs_filtered ("documentation.\n", stream);
- fputs_filtered ("Type \"apropos word\" to search "
- "for commands related to \"word\".\n", stream);
- fputs_filtered ("Type \"apropos -v word\" for full documentation", stream);
+ gdb_puts ("documentation.\n", stream);
+ gdb_puts ("Type \"apropos word\" to search "
+ "for commands related to \"word\".\n", stream);
+ gdb_puts ("Type \"apropos -v word\" for full documentation", stream);
stream->wrap_here (0);
- fputs_filtered (" of commands related to \"word\".\n", stream);
- fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n",
- stream);
+ gdb_puts (" of commands related to \"word\".\n", stream);
+ gdb_puts ("Command name abbreviations are allowed if unambiguous.\n",
+ stream);
}
static void
@@ -1756,7 +1756,7 @@ print_doc_line (struct ui_file *stream, const char *str,
}
else
line_buffer[p - str] = '\0';
- fputs_filtered (line_buffer, stream);
+ gdb_puts (line_buffer, stream);
}
/* Print one-line help for command C.
@@ -1768,7 +1768,7 @@ print_help_for_command (const cmd_list_element &c,
{
fput_command_names_styled (c, true, " -- ", stream);
print_doc_line (stream, c.doc, false);
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
if (!c.default_args.empty ())
fput_alias_definition_styled (c, stream);
fput_aliases_definition_styled (c, stream);
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 5324f64..d3cc560 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -433,7 +433,7 @@ restore_one_section (bfd *ibfd, asection *isec,
(unsigned long) sec_start + sec_offset
+ load_offset + sec_load_count));
else
- puts_filtered ("\n");
+ gdb_puts ("\n");
/* Write the data. */
ret = target_write_memory (sec_start + sec_offset + load_offset,
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 67613aa..fe4682d 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -503,7 +503,7 @@ print_command_trace (const char *fmt, ...)
va_start (args, fmt);
gdb_vprintf (fmt, args);
va_end (args);
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
/* Helper for execute_control_command. */
@@ -1655,7 +1655,7 @@ show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
if (cmdlines)
{
print_command_lines (current_uiout, cmdlines, 1);
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
}
}
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index 6c1652d..bdf7a3d 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -187,7 +187,7 @@ do_show (const char *what, struct ui_file *file,
const char *value)
{
cli_style_option *cso = (cli_style_option *) cmd->context ();
- fputs_filtered (_("The "), file);
+ gdb_puts (_("The "), file);
fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ());
fprintf_filtered (file, _(" %s is: %s\n"), what, value);
}