public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Unify gdb puts functions
@ 2022-03-29 19:42 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-03-29 19:42 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0426ad513f93bb1c5805988e60d6f87fbe738860
commit 0426ad513f93bb1c5805988e60d6f87fbe738860
Author: Tom Tromey <tom@tromey.com>
Date: Sun Jan 2 11:36:44 2022 -0700
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.
Diff:
---
gdb/ada-typeprint.c | 4 +-
gdb/ada-valprint.c | 32 +-
gdb/arm-tdep.c | 14 +-
gdb/ax-general.c | 2 +-
gdb/c-lang.c | 6 +-
gdb/c-typeprint.c | 34 +-
gdb/c-valprint.c | 16 +-
gdb/cli-out.c | 4 +-
gdb/cli/cli-decode.c | 40 +--
gdb/cli/cli-dump.c | 2 +-
gdb/cli/cli-script.c | 4 +-
gdb/cli/cli-style.c | 2 +-
gdb/compile/compile-c-support.c | 128 +++----
gdb/compile/compile-cplus-types.c | 6 +-
gdb/compile/compile.c | 2 +-
gdb/complaints.c | 4 +-
gdb/cp-valprint.c | 26 +-
gdb/disasm.c | 6 +-
gdb/dwarf2/loc.c | 2 +-
gdb/dwarf2/read.c | 6 +-
gdb/event-top.c | 4 +-
gdb/exceptions.c | 2 +-
gdb/exec.c | 2 +-
gdb/expprint.c | 26 +-
gdb/f-lang.h | 6 +-
gdb/f-typeprint.c | 18 +-
gdb/f-valprint.c | 30 +-
gdb/gdbtypes.c | 60 ++--
gdb/gnu-v3-abi.c | 8 +-
gdb/go-typeprint.c | 2 +-
gdb/go-valprint.c | 4 +-
gdb/go32-nat.c | 62 ++--
gdb/guile/scm-ports.c | 2 +-
gdb/guile/scm-pretty-print.c | 28 +-
gdb/i387-tdep.c | 62 ++--
gdb/infcmd.c | 28 +-
gdb/infrun.c | 6 +-
gdb/jit.c | 4 +-
gdb/linux-fork.c | 2 +-
gdb/linux-tdep.c | 2 +-
gdb/linux-thread-db.c | 2 +-
gdb/m2-lang.c | 32 +-
gdb/m2-typeprint.c | 24 +-
gdb/m2-valprint.c | 16 +-
gdb/macrocmd.c | 24 +-
gdb/main.c | 20 +-
gdb/maint-test-options.c | 2 +-
gdb/maint.c | 2 +-
gdb/make-target-delegates.py | 8 +-
gdb/mi/mi-console.c | 2 +-
gdb/mi/mi-interp.c | 8 +-
gdb/mi/mi-main.c | 42 +--
gdb/mi/mi-out.c | 4 +-
gdb/mips-linux-nat.c | 4 +-
gdb/mips-tdep.c | 40 +--
gdb/p-lang.c | 20 +-
gdb/p-lang.h | 2 +-
gdb/p-typeprint.c | 48 +--
gdb/p-valprint.c | 42 +--
gdb/printcmd.c | 26 +-
gdb/psymtab.c | 90 ++---
gdb/python/py-framefilter.c | 4 +-
gdb/python/py-prettyprint.c | 28 +-
gdb/remote-sim.c | 4 +-
gdb/remote.c | 24 +-
gdb/riscv-tdep.c | 2 +-
gdb/rust-lang.c | 102 +++---
gdb/rust-lang.h | 4 +-
gdb/s12z-tdep.c | 2 +-
gdb/ser-base.c | 6 +-
gdb/serial.c | 24 +-
gdb/source.c | 6 +-
gdb/stack.c | 50 +--
gdb/symfile.c | 14 +-
gdb/symmisc.c | 22 +-
gdb/symtab.c | 2 +-
gdb/target-debug.h | 14 +-
gdb/target-delegates.c | 736 +++++++++++++++++++-------------------
gdb/target-descriptions.c | 2 +-
gdb/target.c | 2 +-
gdb/tui/tui-layout.c | 10 +-
gdb/typeprint.c | 8 +-
gdb/utils.c | 48 ++-
gdb/utils.h | 8 +-
gdb/valprint.c | 64 ++--
gdb/windows-nat.c | 58 +--
86 files changed, 1196 insertions(+), 1204 deletions(-)
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index ca26382e195..ee382ebf2c6 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -885,7 +885,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
if (name != NULL && name[0] != '\0')
{
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
fputs_styled (name, function_name_style.style (), stream);
}
@@ -896,7 +896,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
{
if (i > 0)
{
- fputs_filtered ("; ", stream);
+ gdb_puts ("; ", stream);
stream->wrap_here (4);
}
fprintf_filtered (stream, "a%d: ", i + 1);
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index e113088491c..f125a387acb 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -317,7 +317,7 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
/* Don't try to modify a result representing an error. */
if (s[0] == '<')
{
- fputs_filtered (s.c_str (), stream);
+ gdb_puts (s.c_str (), stream);
return;
}
@@ -362,9 +362,9 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
void
ada_printchar (int c, struct type *type, struct ui_file *stream)
{
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
ada_emit_char (c, type, stream, '\'', TYPE_LENGTH (type));
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
}
/* [From print_type_scalar in typeprint.c]. Print VAL on STREAM in a
@@ -466,7 +466,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
if (length == 0)
{
- fputs_filtered ("\"\"", stream);
+ gdb_puts ("\"\"", stream);
return;
}
@@ -482,7 +482,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
if (need_comma)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
need_comma = 0;
}
@@ -500,13 +500,13 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
{
if (in_quotes)
{
- fputs_filtered ("\", ", stream);
+ gdb_puts ("\", ", stream);
in_quotes = 0;
}
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
ada_emit_char (char_at (string, i, type_len, byte_order),
elttype, stream, '\'', type_len);
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"),
metadata_style.style ().ptr (), reps, nullptr);
i = rep1 - 1;
@@ -517,7 +517,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
{
if (!in_quotes)
{
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
in_quotes = 1;
}
ada_emit_char (char_at (string, i, type_len, byte_order),
@@ -528,10 +528,10 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
if (force_ellipses || i < length)
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
void
@@ -633,7 +633,7 @@ print_field_values (struct value *value, struct value *outer_value,
ada_name_prefix_len (type->field (i).name ()),
type->field (i).name ());
annotate_field_name_end ();
- fputs_filtered (" => ", stream);
+ gdb_puts (" => ", stream);
annotate_field_value ();
if (TYPE_FIELD_PACKED (type, i))
@@ -734,7 +734,7 @@ ada_value_print_ptr (struct value *val,
&& TYPE_TARGET_TYPE (value_type (val))->code () == TYPE_CODE_INT
&& TYPE_LENGTH (TYPE_TARGET_TYPE (value_type (val))) == 0)
{
- fputs_filtered ("null", stream);
+ gdb_puts ("null", stream);
return;
}
@@ -802,7 +802,7 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
- fputs_filtered (paddress (gdbarch, addr), stream);
+ gdb_puts (paddress (gdbarch, addr), stream);
}
else
{
@@ -811,7 +811,7 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
{
LONGEST c;
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
c = unpack_long (type, valaddr);
ada_printchar (c, type, stream);
}
@@ -971,7 +971,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
deref_val_int = unpack_pointer (type, valaddr + offset_aligned);
if (deref_val_int == 0)
{
- fputs_filtered ("(null)", stream);
+ gdb_puts ("(null)", stream);
return;
}
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index d216d1daff7..5cd5b160534 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -4015,15 +4015,15 @@ static void
print_fpu_flags (struct ui_file *file, int flags)
{
if (flags & (1 << 0))
- fputs_filtered ("IVO ", file);
+ gdb_puts ("IVO ", file);
if (flags & (1 << 1))
- fputs_filtered ("DVZ ", file);
+ gdb_puts ("DVZ ", file);
if (flags & (1 << 2))
- fputs_filtered ("OFL ", file);
+ gdb_puts ("OFL ", file);
if (flags & (1 << 3))
- fputs_filtered ("UFL ", file);
+ gdb_puts ("UFL ", file);
if (flags & (1 << 4))
- fputs_filtered ("INX ", file);
+ gdb_puts ("INX ", file);
fputc_filtered ('\n', file);
}
@@ -4042,10 +4042,10 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
else
fprintf_filtered (file, _("Software FPU type %d\n"), type);
/* i18n: [floating point unit] mask */
- fputs_filtered (_("mask: "), file);
+ gdb_puts (_("mask: "), file);
print_fpu_flags (file, status >> 16);
/* i18n: [floating point unit] flags */
- fputs_filtered (_("flags: "), file);
+ gdb_puts (_("flags: "), file);
print_fpu_flags (file, status);
}
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index f85301db4fd..f829b32e015 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -398,7 +398,7 @@ ax_print (struct ui_file *f, struct agent_expr *x)
fprintf_filtered (f, "%3d %s", i, aop_map[op].name);
if (aop_map[op].op_size > 0)
{
- fputs_filtered (" ", f);
+ gdb_puts (" ", f);
print_longest (f, 'd', 0,
read_const (x, i + 1, aop_map[op].op_size));
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 1f7cac7bef1..2fd86ec1019 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -206,13 +206,13 @@ c_printstr (struct ui_file *stream, struct type *type,
case C_STRING:
break;
case C_WIDE_STRING:
- fputs_filtered ("L", stream);
+ gdb_puts ("L", stream);
break;
case C_STRING_16:
- fputs_filtered ("u", stream);
+ gdb_puts ("u", stream);
break;
case C_STRING_32:
- fputs_filtered ("U", stream);
+ gdb_puts ("U", stream);
break;
}
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 405ede8b9c8..262b3e1f510 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -91,7 +91,7 @@ print_name_maybe_canonical (const char *name,
find_typedef_for_canonicalize,
(void *) flags);
- fputs_filtered (s != nullptr ? s.get () : name, stream);
+ gdb_puts (s != nullptr ? s.get () : name, stream);
}
\f
@@ -120,9 +120,9 @@ c_print_type_1 (struct type *type,
if (local_name != NULL)
{
c_type_print_modifier (type, stream, 0, 1, language);
- fputs_filtered (local_name, stream);
+ gdb_puts (local_name, stream);
if (varstring != NULL && *varstring != '\0')
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
else
{
@@ -138,7 +138,7 @@ c_print_type_1 (struct type *type,
|| code == TYPE_CODE_MEMBERPTR
|| code == TYPE_CODE_METHODPTR
|| TYPE_IS_REFERENCE (type))))
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
c_type_print_varspec_prefix (type, stream, show, 0, need_post_space,
language, flags, podata);
@@ -251,7 +251,7 @@ cp_type_print_derivation_info (struct ui_file *stream,
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
stream->wrap_here (8);
- fputs_filtered (i == 0 ? ": " : ", ", stream);
+ gdb_puts (i == 0 ? ": " : ", ", stream);
fprintf_filtered (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i)
? "public" : (TYPE_FIELD_PROTECTED (type, i)
@@ -265,7 +265,7 @@ cp_type_print_derivation_info (struct ui_file *stream,
}
if (i > 0)
{
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
}
@@ -287,7 +287,7 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
language_cplus, DMGL_ANSI);
fprintf_symbol_filtered (stream, varstring,
language_cplus, DMGL_ANSI);
- fputs_filtered ("(", stream);
+ gdb_puts ("(", stream);
/* Skip the class variable. We keep this here to accommodate older
compilers and debug formats which may not support artificial
@@ -894,7 +894,7 @@ c_type_print_template_args (const struct type_print_options *flags,
}
else
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
stream->wrap_here (9);
fprintf_filtered (stream, "%s = ", sym->linkage_name ());
}
@@ -903,7 +903,7 @@ c_type_print_template_args (const struct type_print_options *flags,
}
if (!first)
- fputs_filtered (_("] "), stream);
+ gdb_puts (_("] "), stream);
}
/* Use 'print_spaces_filtered', but take into consideration the
@@ -1079,7 +1079,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
here. */
print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
if (show < 0)
@@ -1300,7 +1300,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
(TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, -1, 0, language, &local_flags, podata);
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
if (TYPE_FN_FIELD_STUB (f, j))
{
@@ -1352,10 +1352,10 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
int length = p - demangled_no_class;
std::string demangled_no_static (demangled_no_class,
length);
- fputs_filtered (demangled_no_static.c_str (), stream);
+ gdb_puts (demangled_no_static.c_str (), stream);
}
else
- fputs_filtered (demangled_no_class, stream);
+ gdb_puts (demangled_no_class, stream);
}
fprintf_filtered (stream, ";\n");
@@ -1556,7 +1556,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
{
print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
stream->wrap_here (4);
@@ -1620,7 +1620,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0)
{
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
fprintf_filtered (stream, "{\n");
if (type->num_fields () == 0)
{
@@ -1684,8 +1684,8 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
break;
case TYPE_CODE_NAMESPACE:
- fputs_filtered ("namespace ", stream);
- fputs_filtered (type->name (), stream);
+ gdb_puts ("namespace ", stream);
+ gdb_puts (type->name (), stream);
break;
default:
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 0d30700c06d..c034704febf 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -158,7 +158,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
demangle);
else if (options->addressprint)
{
- fputs_filtered (paddress (gdbarch, address), stream);
+ gdb_puts (paddress (gdbarch, address), stream);
want_space = 1;
}
@@ -169,7 +169,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
&& address != 0)
{
if (want_space)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
val_print_string (unresolved_elttype, NULL, address, -1, stream, options);
}
else if (cp_is_vtbl_member (type))
@@ -185,10 +185,10 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
&& (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
{
if (want_space)
- fputs_filtered (" ", stream);
- fputs_filtered (" <", stream);
- fputs_filtered (msymbol.minsym->print_name (), stream);
- fputs_filtered (">", stream);
+ gdb_puts (" ", stream);
+ gdb_puts (" <", stream);
+ gdb_puts (msymbol.minsym->print_name (), stream);
+ gdb_puts (">", stream);
want_space = 1;
}
@@ -199,7 +199,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
struct type *wtype;
if (want_space)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
if (msymbol.minsym != NULL)
{
@@ -408,7 +408,7 @@ c_value_print_int (struct value *val, struct ui_file *stream,
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (c_textual_element_type (type, options->format))
{
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
current_language->printchar (unpack_long (type, valaddr), type,
stream);
}
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index f6a508393ef..0c87a820568 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -221,9 +221,9 @@ cli_ui_out::do_text (const char *string)
return;
if (test_flags (unfiltered_output))
- fputs_unfiltered (string, m_streams.back ());
+ gdb_puts (string, m_streams.back ());
else
- fputs_filtered (string, m_streams.back ());
+ gdb_puts (string, m_streams.back ());
}
void
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 3c21c6e6c5b..0233401625a 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 5324f647d80..d3cc560a00c 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 67613aa0bc0..fe4682d8513 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 6c1652d3986..bdf7a3de62b 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);
}
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
index 4d9abfb5e89..52a7cc176b8 100644
--- a/gdb/compile/compile-c-support.c
+++ b/gdb/compile/compile-c-support.c
@@ -167,14 +167,14 @@ print_one_macro (const char *name, const struct macro_definition *macro,
{
int i;
- fputs_filtered ("(", file);
+ gdb_puts ("(", file);
for (i = 0; i < macro->argc; i++)
{
- fputs_filtered (macro->argv[i], file);
+ gdb_puts (macro->argv[i], file);
if (i + 1 < macro->argc)
- fputs_filtered (", ", file);
+ gdb_puts (", ", file);
}
- fputs_filtered (")", file);
+ gdb_puts (")", file);
}
fprintf_filtered (file, " %s\n#endif\n", macro->replacement);
@@ -218,8 +218,8 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
int i;
int seen = 0;
- fputs_unfiltered ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n",
- stream);
+ gdb_puts ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n",
+ stream);
if (!registers_used.empty ())
for (i = 0; i < gdbarch_num_regs (gdbarch); ++i)
@@ -241,7 +241,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
register types (typically flags or vectors), emit a
maximally-aligned array of the correct size. */
- fputs_unfiltered (" ", stream);
+ gdb_puts (" ", stream);
switch (regtype->code ())
{
case TYPE_CODE_PTR:
@@ -257,7 +257,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
if (mode != NULL)
{
if (regtype->is_unsigned ())
- fputs_unfiltered ("unsigned ", stream);
+ gdb_puts ("unsigned ", stream);
fprintf_unfiltered (stream,
"int %s"
" __attribute__ ((__mode__(__%s__)))",
@@ -277,15 +277,15 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
regname.c_str (),
pulongest (TYPE_LENGTH (regtype)));
}
- fputs_unfiltered (";\n", stream);
+ gdb_puts (";\n", stream);
}
}
if (!seen)
- fputs_unfiltered (" char " COMPILE_I_SIMPLE_REGISTER_DUMMY ";\n",
- stream);
+ gdb_puts (" char " COMPILE_I_SIMPLE_REGISTER_DUMMY ";\n",
+ stream);
- fputs_unfiltered ("};\n\n", stream);
+ gdb_puts ("};\n\n", stream);
}
/* C-language policy to emit a push user expression pragma into BUF. */
@@ -294,7 +294,7 @@ struct c_push_user_expression
{
void push_user_expression (struct ui_file *buf)
{
- fputs_unfiltered ("#pragma GCC user_expression\n", buf);
+ gdb_puts ("#pragma GCC user_expression\n", buf);
}
};
@@ -320,32 +320,32 @@ struct c_add_code_header
switch (type)
{
case COMPILE_I_SIMPLE_SCOPE:
- fputs_unfiltered ("void "
- GCC_FE_WRAPPER_FUNCTION
- " (struct "
- COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
- " *"
- COMPILE_I_SIMPLE_REGISTER_ARG_NAME
- ") {\n",
- buf);
+ gdb_puts ("void "
+ GCC_FE_WRAPPER_FUNCTION
+ " (struct "
+ COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
+ " *"
+ COMPILE_I_SIMPLE_REGISTER_ARG_NAME
+ ") {\n",
+ buf);
break;
case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE:
/* <string.h> is needed for a memcpy call below. */
- fputs_unfiltered ("#include <string.h>\n"
- "void "
- GCC_FE_WRAPPER_FUNCTION
- " (struct "
- COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
- " *"
- COMPILE_I_SIMPLE_REGISTER_ARG_NAME
- ", "
- COMPILE_I_PRINT_OUT_ARG_TYPE
- " "
- COMPILE_I_PRINT_OUT_ARG
- ") {\n",
- buf);
+ gdb_puts ("#include <string.h>\n"
+ "void "
+ GCC_FE_WRAPPER_FUNCTION
+ " (struct "
+ COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
+ " *"
+ COMPILE_I_SIMPLE_REGISTER_ARG_NAME
+ ", "
+ COMPILE_I_PRINT_OUT_ARG_TYPE
+ " "
+ COMPILE_I_PRINT_OUT_ARG
+ ") {\n",
+ buf);
break;
case COMPILE_I_RAW_SCOPE:
@@ -369,7 +369,7 @@ struct c_add_code_footer
case COMPILE_I_SIMPLE_SCOPE:
case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE:
- fputs_unfiltered ("}\n", buf);
+ gdb_puts ("}\n", buf);
break;
case COMPILE_I_RAW_SCOPE:
@@ -405,10 +405,10 @@ struct c_add_input
break;
default:
- fputs_unfiltered (input, buf);
+ gdb_puts (input, buf);
break;
}
- fputs_unfiltered ("\n", buf);
+ gdb_puts ("\n", buf);
}
};
@@ -419,7 +419,7 @@ struct cplus_push_user_expression
{
void push_user_expression (struct ui_file *buf)
{
- fputs_unfiltered ("#pragma GCC push_user_expression\n", buf);
+ gdb_puts ("#pragma GCC push_user_expression\n", buf);
}
};
@@ -429,7 +429,7 @@ struct cplus_pop_user_expression
{
void pop_user_expression (struct ui_file *buf)
{
- fputs_unfiltered ("#pragma GCC pop_user_expression\n", buf);
+ gdb_puts ("#pragma GCC pop_user_expression\n", buf);
}
};
@@ -444,33 +444,33 @@ struct cplus_add_code_header
switch (type)
{
case COMPILE_I_SIMPLE_SCOPE:
- fputs_unfiltered ("void "
- GCC_FE_WRAPPER_FUNCTION
- " (struct "
- COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
- " *"
- COMPILE_I_SIMPLE_REGISTER_ARG_NAME
- ") {\n",
- buf);
+ gdb_puts ("void "
+ GCC_FE_WRAPPER_FUNCTION
+ " (struct "
+ COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
+ " *"
+ COMPILE_I_SIMPLE_REGISTER_ARG_NAME
+ ") {\n",
+ buf);
break;
case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE:
- fputs_unfiltered (
- "#include <cstring>\n"
- "#include <bits/move.h>\n"
- "void "
- GCC_FE_WRAPPER_FUNCTION
- " (struct "
- COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
- " *"
- COMPILE_I_SIMPLE_REGISTER_ARG_NAME
- ", "
- COMPILE_I_PRINT_OUT_ARG_TYPE
- " "
- COMPILE_I_PRINT_OUT_ARG
- ") {\n",
- buf);
+ gdb_puts (
+ "#include <cstring>\n"
+ "#include <bits/move.h>\n"
+ "void "
+ GCC_FE_WRAPPER_FUNCTION
+ " (struct "
+ COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
+ " *"
+ COMPILE_I_SIMPLE_REGISTER_ARG_NAME
+ ", "
+ COMPILE_I_PRINT_OUT_ARG_TYPE
+ " "
+ COMPILE_I_PRINT_OUT_ARG
+ ") {\n",
+ buf);
break;
case COMPILE_I_RAW_SCOPE:
@@ -512,10 +512,10 @@ struct cplus_add_input
break;
default:
- fputs_unfiltered (input, buf);
+ gdb_puts (input, buf);
break;
}
- fputs_unfiltered ("\n", buf);
+ gdb_puts ("\n", buf);
}
};
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index f0ac05f4f2a..18cf7b63338 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -1246,9 +1246,9 @@ static void
compile_cplus_debug_output_1 (const char *arg)
{
if (arg == nullptr)
- fputs_unfiltered ("NULL", gdb_stdlog);
+ gdb_puts ("NULL", gdb_stdlog);
else
- fputs_unfiltered (arg, gdb_stdlog);
+ gdb_puts (arg, gdb_stdlog);
}
static void
@@ -1275,7 +1275,7 @@ compile_cplus_debug_output (T arg, Targs... Args)
#define OUTPUT_DEBUG_RESULT(R) \
if (debug_compile_cplus_types) \
{ \
- fputs_unfiltered (": ", gdb_stdlog); \
+ gdb_puts (": ", gdb_stdlog); \
compile_cplus_debug_output (R); \
fputc_unfiltered ('\n', gdb_stdlog); \
} \
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 5ab4e48f306..42df80e7d6b 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -647,7 +647,7 @@ get_args (const compile_instance *compiler, struct gdbarch *gdbarch)
static void
print_callback (void *ignore, const char *message)
{
- fputs_filtered (message, gdb_stderr);
+ gdb_puts (message, gdb_stderr);
}
/* Process the compilation request. On success it returns the object
diff --git a/gdb/complaints.c b/gdb/complaints.c
index b582bf38f11..b1757d4bdd0 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -50,9 +50,9 @@ complaint_internal (const char *fmt, ...)
(*deprecated_warning_hook) (fmt, args);
else
{
- fputs_filtered (_("During symbol reading: "), gdb_stderr);
+ gdb_puts (_("During symbol reading: "), gdb_stderr);
gdb_vprintf (gdb_stderr, fmt, args);
- fputs_filtered ("\n", gdb_stderr);
+ gdb_puts ("\n", gdb_stderr);
}
va_end (args);
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 8e2b631c839..07e0492044f 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -198,9 +198,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (fields_seen)
{
- fputs_filtered (",", stream);
+ gdb_puts (",", stream);
if (!options->prettyformat)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
}
else if (n_baseclasses > 0)
{
@@ -208,9 +208,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
- fputs_filtered ("members of ", stream);
- fputs_filtered (type->name (), stream);
- fputs_filtered (":", stream);
+ gdb_puts ("members of ", stream);
+ gdb_puts (type->name (), stream);
+ gdb_puts (":", stream);
}
}
fields_seen = 1;
@@ -229,7 +229,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (field_is_static (&type->field (i)))
{
- fputs_filtered ("static ", stream);
+ gdb_puts ("static ", stream);
fprintf_symbol_filtered (stream,
type->field (i).name (),
current_language->la_language,
@@ -247,7 +247,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
/* Do not print leading '=' in case of anonymous
unions. */
if (strcmp (type->field (i).name (), ""))
- fputs_filtered (" = ", stream);
+ gdb_puts (" = ", stream);
else
{
/* If this is an anonymous field then we want to consider it
@@ -481,11 +481,11 @@ cp_print_value (struct value *val, struct ui_file *stream,
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
- fputs_filtered ("<", stream);
+ gdb_puts ("<", stream);
/* Not sure what the best notation is in the case where there is
no baseclass name. */
- fputs_filtered (basename ? basename : "", stream);
- fputs_filtered ("> = ", stream);
+ gdb_puts (basename ? basename : "", stream);
+ gdb_puts ("> = ", stream);
if (skip < 0)
val_print_unavailable (stream);
@@ -516,7 +516,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
0);
}
}
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
flush_it:
;
@@ -701,10 +701,10 @@ cp_print_class_member (const gdb_byte *valaddr, struct type *type,
{
const char *name;
- fputs_filtered (prefix, stream);
+ gdb_puts (prefix, stream);
name = self_type->name ();
if (name)
- fputs_filtered (name, stream);
+ gdb_puts (name, stream);
else
c_type_print_base (self_type, stream, 0, 0, &type_print_raw_options);
fprintf_filtered (stream, "::");
diff --git a/gdb/disasm.c b/gdb/disasm.c
index c179b2e03c8..f00f598f99a 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -1122,9 +1122,9 @@ show_disassembler_options_sfunc (struct ui_file *file, int from_tty,
if (valid_options_and_args == NULL)
{
- fputs_filtered (_("There are no disassembler options available "
- "for this architecture.\n"),
- file);
+ gdb_puts (_("There are no disassembler options available "
+ "for this architecture.\n"),
+ file);
return;
}
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 5cfd5a2807c..09455e2e952 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -917,7 +917,7 @@ chain_candidate (struct gdbarch *gdbarch,
fprintf_unfiltered (gdb_stdlog, "tailcall: reduced:");
for (idx = 0; idx < (*resultp)->callers; idx++)
tailcall_dump (gdbarch, (*resultp)->call_site[idx]);
- fputs_unfiltered (" |", gdb_stdlog);
+ gdb_puts (" |", gdb_stdlog);
for (idx = 0; idx < (*resultp)->callees; idx++)
tailcall_dump (gdbarch,
(*resultp)->call_site[(*resultp)->length
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 6c41ede48b5..6fc9e37ed27 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -23094,7 +23094,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
case DW_FORM_addrx:
case DW_FORM_GNU_addr_index:
fprintf_unfiltered (f, "address: ");
- fputs_filtered (hex_string (die->attrs[i].as_address ()), f);
+ gdb_puts (hex_string (die->attrs[i].as_address ()), f);
break;
case DW_FORM_block2:
case DW_FORM_block4:
@@ -23112,11 +23112,11 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
break;
case DW_FORM_ref_addr:
fprintf_unfiltered (f, "ref address: ");
- fputs_filtered (hex_string (die->attrs[i].as_unsigned ()), f);
+ gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f);
break;
case DW_FORM_GNU_ref_alt:
fprintf_unfiltered (f, "alt ref address: ");
- fputs_filtered (hex_string (die->attrs[i].as_unsigned ()), f);
+ gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f);
break;
case DW_FORM_ref1:
case DW_FORM_ref2:
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 41cbe23f189..aa3b21bec95 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1236,8 +1236,8 @@ async_disconnect (gdb_client_data arg)
catch (const gdb_exception &exception)
{
- fputs_filtered ("Could not kill the program being debugged",
- gdb_stderr);
+ gdb_puts ("Could not kill the program being debugged",
+ gdb_stderr);
exception_print (gdb_stderr, exception);
}
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index b23ab0e4f33..73c4818a285 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -81,7 +81,7 @@ print_exception (struct ui_file *file, const struct gdb_exception &e)
{
end = strchr (start, '\n');
if (end == NULL)
- fputs_filtered (start, file);
+ gdb_puts (start, file);
else
{
end++;
diff --git a/gdb/exec.c b/gdb/exec.c
index 43ecb730a65..caf790a0dfb 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -980,7 +980,7 @@ exec_target::files_info ()
print_section_info (¤t_program_space->target_sections (),
current_program_space->exec_bfd ());
else
- puts_filtered (_("\t<no file loaded>\n"));
+ gdb_puts (_("\t<no file loaded>\n"));
}
static void
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 381a10d85be..4dab3a27a94 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -138,9 +138,9 @@ dump_for_expression (struct ui_file *stream, int depth,
{
fprintf_filtered (stream, _("%*sType flags: "), depth, "");
if (flags & TYPE_INSTANCE_FLAG_CONST)
- fputs_filtered ("const ", stream);
+ gdb_puts ("const ", stream);
if (flags & TYPE_INSTANCE_FLAG_VOLATILE)
- fputs_filtered ("volatile", stream);
+ gdb_puts ("volatile", stream);
fprintf_filtered (stream, "\n");
}
@@ -152,24 +152,24 @@ dump_for_expression (struct ui_file *stream, int depth,
switch (flags & ~C_CHAR)
{
case C_WIDE_STRING:
- fputs_filtered (_("wide "), stream);
+ gdb_puts (_("wide "), stream);
break;
case C_STRING_16:
- fputs_filtered (_("u16 "), stream);
+ gdb_puts (_("u16 "), stream);
break;
case C_STRING_32:
- fputs_filtered (_("u32 "), stream);
+ gdb_puts (_("u32 "), stream);
break;
default:
- fputs_filtered (_("ordinary "), stream);
+ gdb_puts (_("ordinary "), stream);
break;
}
if ((flags & C_CHAR) != 0)
- fputs_filtered (_("char"), stream);
+ gdb_puts (_("char"), stream);
else
- fputs_filtered (_("string"), stream);
- fputs_filtered ("\n", stream);
+ gdb_puts (_("string"), stream);
+ gdb_puts ("\n", stream);
}
void
@@ -178,13 +178,13 @@ dump_for_expression (struct ui_file *stream, int depth,
{
fprintf_filtered (stream, _("%*sRange:"), depth, "");
if ((flags & RANGE_LOW_BOUND_DEFAULT) != 0)
- fputs_filtered (_("low-default "), stream);
+ gdb_puts (_("low-default "), stream);
if ((flags & RANGE_HIGH_BOUND_DEFAULT) != 0)
- fputs_filtered (_("high-default "), stream);
+ gdb_puts (_("high-default "), stream);
if ((flags & RANGE_HIGH_BOUND_EXCLUSIVE) != 0)
- fputs_filtered (_("high-exclusive "), stream);
+ gdb_puts (_("high-exclusive "), stream);
if ((flags & RANGE_HAS_STRIDE) != 0)
- fputs_filtered (_("has-stride"), stream);
+ gdb_puts (_("has-stride"), stream);
fprintf_filtered (stream, "\n");
}
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index 11debd5569f..2a1f6c7e737 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -161,9 +161,9 @@ public:
void printchar (int ch, struct type *chtype,
struct ui_file *stream) const override
{
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
emitchar (ch, chtype, stream, '\'');
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
}
/* See language.h. */
@@ -176,7 +176,7 @@ public:
const char *type_encoding = get_encoding (elttype);
if (TYPE_LENGTH (elttype) == 4)
- fputs_filtered ("4_", stream);
+ gdb_puts ("4_", stream);
if (!encoding || !*encoding)
encoding = type_encoding;
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 3b26bf74b61..5065ffa5d37 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -69,14 +69,14 @@ f_language::print_type (struct type *type, const char *varstring,
== TYPE_CODE_METHOD)
|| (TYPE_TARGET_TYPE (type)->code ()
== TYPE_CODE_ARRAY))))))
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
f_type_print_varspec_prefix (type, stream, show, 0);
if (varstring != NULL)
{
int demangled_args;
- fputs_filtered (varstring, stream);
+ gdb_puts (varstring, stream);
/* For demangled function names, we have the arglist as part of the name,
so don't print an additional pair of ()'s. */
@@ -209,7 +209,7 @@ f_language::f_type_print_varspec_suffix (struct type *type,
{
LONGEST upper_bound = f77_get_upperbound (type);
- fputs_filtered (plongest (upper_bound), stream);
+ gdb_puts (plongest (upper_bound), stream);
}
}
@@ -250,7 +250,7 @@ f_language::f_type_print_varspec_suffix (struct type *type,
{
if (i > 0)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
stream->wrap_here (4);
}
print_type (type->field (i).type (), "", stream, -1, 0, 0);
@@ -399,25 +399,25 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
fprintf_filtered (stream, "%*sType, C_Union :: ", level, "");
else
fprintf_filtered (stream, "%*sType ", level, "");
- fputs_filtered (type->name (), stream);
+ gdb_puts (type->name (), stream);
/* According to the definition,
we only print structure elements in case show > 0. */
if (show > 0)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
for (index = 0; index < type->num_fields (); index++)
{
f_type_print_base (type->field (index).type (), stream,
show - 1, level + 4);
- fputs_filtered (" :: ", stream);
+ gdb_puts (" :: ", stream);
fputs_styled (type->field (index).name (),
variable_name_style.style (), stream);
f_type_print_varspec_suffix (type->field (index).type (),
stream, show - 1, 0, 0, 0, false);
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
}
fprintf_filtered (stream, "%*sEnd Type ", level, "");
- fputs_filtered (type->name (), stream);
+ gdb_puts (type->name (), stream);
}
break;
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index b64750bac7b..e56815c2813 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -144,7 +144,7 @@ public:
{
bool cont = should_continue && (m_elts < m_options->print_max);
if (!cont && should_continue)
- fputs_filtered ("...", m_stream);
+ gdb_puts ("...", m_stream);
return cont;
}
@@ -162,7 +162,7 @@ public:
m_stats[dim_indx].nelts = nelts;
}
- fputs_filtered ("(", m_stream);
+ gdb_puts ("(", m_stream);
}
/* Called when we finish processing a batch of items within a dimension
@@ -171,9 +171,9 @@ public:
separators between elements, and dimensions of the array. */
void finish_dimension (bool inner_p, bool last_p)
{
- fputs_filtered (")", m_stream);
+ gdb_puts (")", m_stream);
if (!last_p)
- fputs_filtered (" ", m_stream);
+ gdb_puts (" ", m_stream);
m_dimension--;
}
@@ -218,7 +218,7 @@ public:
nullptr);
annotate_elt_rep_end ();
if (!repeated)
- fputs_filtered (" ", m_stream);
+ gdb_puts (" ", m_stream);
m_elts += nrepeats * m_stats[dim_indx + 1].nelts;
}
else
@@ -245,7 +245,7 @@ public:
nrepeats++;
}
else if (last_p)
- fputs_filtered ("...", m_stream);
+ gdb_puts ("...", m_stream);
}
}
@@ -301,7 +301,7 @@ public:
common_val_print (e_val, m_stream, m_recurse, m_options,
current_language);
if (i > 1)
- fputs_filtered (", ", m_stream);
+ gdb_puts (", ", m_stream);
}
}
printed = true;
@@ -314,14 +314,14 @@ public:
= value_from_component (m_val, elt_type, elt_off);
if (printed)
- fputs_filtered (", ", m_stream);
+ gdb_puts (", ", m_stream);
maybe_print_array_index (m_stats[dim_indx].index_type, index,
m_stream, m_options);
common_val_print (e_val, m_stream, m_recurse, m_options,
current_language);
}
if (!last_p)
- fputs_filtered (", ", m_stream);
+ gdb_puts (", ", m_stream);
}
m_elt_type_prev = elt_type;
@@ -490,7 +490,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
stream, demangle);
else if (options->addressprint && options->format != 's')
{
- fputs_filtered (paddress (gdbarch, addr), stream);
+ gdb_puts (paddress (gdbarch, addr), stream);
want_space = 1;
}
@@ -502,7 +502,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
&& addr != 0)
{
if (want_space)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
stream, options);
}
@@ -542,13 +542,13 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
field = value_field (val, index);
if (printed_field > 0)
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
if (field_name != NULL)
{
fputs_styled (field_name, variable_name_style.style (),
stream);
- fputs_filtered (" = ", stream);
+ gdb_puts (" = ", stream);
}
common_val_print (field, stream, recurse + 1,
@@ -575,9 +575,9 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
represented. Different compilers use different non zero
values to represent logical true. */
if (longval == 0)
- fputs_filtered (f_decorations.false_name, stream);
+ gdb_puts (f_decorations.false_name, stream);
else
- fputs_filtered (f_decorations.true_name, stream);
+ gdb_puts (f_decorations.true_name, stream);
}
break;
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index f41d6bd960e..d029aeaccd6 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4888,7 +4888,7 @@ print_bit_vector (B_TYPE *bits, int nbits)
{
if ((bitno % 8) == 0)
{
- puts_filtered (" ");
+ gdb_puts (" ");
}
if (B_TST (bits, bitno))
printf_filtered (("1"));
@@ -5019,7 +5019,7 @@ print_cplus_stuff (struct type *type, int spaces)
print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type),
TYPE_N_BASECLASSES (type));
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
if (type->num_fields () > 0)
{
@@ -5031,7 +5031,7 @@ print_cplus_stuff (struct type *type, int spaces)
host_address_to_string (TYPE_FIELD_PRIVATE_BITS (type)));
print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type),
type->num_fields ());
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL)
{
@@ -5041,7 +5041,7 @@ print_cplus_stuff (struct type *type, int spaces)
host_address_to_string (TYPE_FIELD_PROTECTED_BITS (type)));
print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type),
type->num_fields ());
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
}
if (TYPE_NFN_FIELDS (type) > 0)
@@ -5223,7 +5223,7 @@ recursive_dump_type (struct type *type, int spaces)
printf_filtered ("(UNKNOWN TYPE CODE)");
break;
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
printf_filtered ("%*slength %s\n", spaces, "",
pulongest (TYPE_LENGTH (type)));
if (type->is_objfile_owned ())
@@ -5248,87 +5248,87 @@ recursive_dump_type (struct type *type, int spaces)
(unsigned) type->instance_flags ());
if (TYPE_CONST (type))
{
- puts_filtered (" TYPE_CONST");
+ gdb_puts (" TYPE_CONST");
}
if (TYPE_VOLATILE (type))
{
- puts_filtered (" TYPE_VOLATILE");
+ gdb_puts (" TYPE_VOLATILE");
}
if (TYPE_CODE_SPACE (type))
{
- puts_filtered (" TYPE_CODE_SPACE");
+ gdb_puts (" TYPE_CODE_SPACE");
}
if (TYPE_DATA_SPACE (type))
{
- puts_filtered (" TYPE_DATA_SPACE");
+ gdb_puts (" TYPE_DATA_SPACE");
}
if (TYPE_ADDRESS_CLASS_1 (type))
{
- puts_filtered (" TYPE_ADDRESS_CLASS_1");
+ gdb_puts (" TYPE_ADDRESS_CLASS_1");
}
if (TYPE_ADDRESS_CLASS_2 (type))
{
- puts_filtered (" TYPE_ADDRESS_CLASS_2");
+ gdb_puts (" TYPE_ADDRESS_CLASS_2");
}
if (TYPE_RESTRICT (type))
{
- puts_filtered (" TYPE_RESTRICT");
+ gdb_puts (" TYPE_RESTRICT");
}
if (TYPE_ATOMIC (type))
{
- puts_filtered (" TYPE_ATOMIC");
+ gdb_puts (" TYPE_ATOMIC");
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
printf_filtered ("%*sflags", spaces, "");
if (type->is_unsigned ())
{
- puts_filtered (" TYPE_UNSIGNED");
+ gdb_puts (" TYPE_UNSIGNED");
}
if (type->has_no_signedness ())
{
- puts_filtered (" TYPE_NOSIGN");
+ gdb_puts (" TYPE_NOSIGN");
}
if (type->endianity_is_not_default ())
{
- puts_filtered (" TYPE_ENDIANITY_NOT_DEFAULT");
+ gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
}
if (type->is_stub ())
{
- puts_filtered (" TYPE_STUB");
+ gdb_puts (" TYPE_STUB");
}
if (type->target_is_stub ())
{
- puts_filtered (" TYPE_TARGET_STUB");
+ gdb_puts (" TYPE_TARGET_STUB");
}
if (type->is_prototyped ())
{
- puts_filtered (" TYPE_PROTOTYPED");
+ gdb_puts (" TYPE_PROTOTYPED");
}
if (type->has_varargs ())
{
- puts_filtered (" TYPE_VARARGS");
+ gdb_puts (" TYPE_VARARGS");
}
/* This is used for things like AltiVec registers on ppc. Gcc emits
an attribute for the array type, which tells whether or not we
have a vector, instead of a regular array. */
if (type->is_vector ())
{
- puts_filtered (" TYPE_VECTOR");
+ gdb_puts (" TYPE_VECTOR");
}
if (type->is_fixed_instance ())
{
- puts_filtered (" TYPE_FIXED_INSTANCE");
+ gdb_puts (" TYPE_FIXED_INSTANCE");
}
if (type->stub_is_supported ())
{
- puts_filtered (" TYPE_STUB_SUPPORTED");
+ gdb_puts (" TYPE_STUB_SUPPORTED");
}
if (TYPE_NOTTEXT (type))
{
- puts_filtered (" TYPE_NOTTEXT");
+ gdb_puts (" TYPE_NOTTEXT");
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ());
if (TYPE_ASSOCIATED_PROP (type) != nullptr
|| TYPE_ALLOCATED_PROP (type) != nullptr)
@@ -5396,10 +5396,10 @@ recursive_dump_type (struct type *type, int spaces)
printf_filtered ("%*sfloatformat ", spaces, "");
if (TYPE_FLOATFORMAT (type) == NULL
|| TYPE_FLOATFORMAT (type)->name == NULL)
- puts_filtered ("(null)");
+ gdb_puts ("(null)");
else
- puts_filtered (TYPE_FLOATFORMAT (type)->name);
- puts_filtered ("\n");
+ gdb_puts (TYPE_FLOATFORMAT (type)->name);
+ gdb_puts ("\n");
break;
case TYPE_SPECIFIC_FUNC:
@@ -5416,7 +5416,7 @@ recursive_dump_type (struct type *type, int spaces)
case TYPE_SPECIFIC_FIXED_POINT:
printf_filtered ("%*sfixed_point_info ", spaces, "");
print_fixed_point_type_info (type, spaces);
- puts_filtered ("\n");
+ gdb_puts ("\n");
break;
case TYPE_SPECIFIC_INT:
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 0cbb8d0d3a6..da4f27e39d5 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -649,18 +649,18 @@ gnuv3_print_method_ptr (const gdb_byte *contents,
fprintf_filtered (stream, "&virtual ");
if (demangled_name == NULL)
- fputs_filtered (physname, stream);
+ gdb_puts (physname, stream);
else
- fputs_filtered (demangled_name.get (), stream);
+ gdb_puts (demangled_name.get (), stream);
return;
}
}
else if (ptr_value != 0)
{
/* Found a non-virtual function: print out the type. */
- fputs_filtered ("(", stream);
+ gdb_puts ("(", stream);
c_print_type (type, "", stream, -1, 0, &type_print_raw_options);
- fputs_filtered (") ", stream);
+ gdb_puts (") ", stream);
}
/* We didn't find it; print the raw data. */
diff --git a/gdb/go-typeprint.c b/gdb/go-typeprint.c
index 0a463871546..f8f155fbb64 100644
--- a/gdb/go-typeprint.c
+++ b/gdb/go-typeprint.c
@@ -54,7 +54,7 @@ go_language::print_type (struct type *type, const char *varstring,
if (type->code () == TYPE_CODE_ARRAY
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR)
{
- fputs_filtered ("string", stream);
+ gdb_puts ("string", stream);
return;
}
diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c
index 32bb6790cba..ade99c9620a 100644
--- a/gdb/go-valprint.c
+++ b/gdb/go-valprint.c
@@ -66,8 +66,8 @@ print_go_string (struct type *type,
/* TODO(dje): Print address of struct or actual string? */
if (options->addressprint)
{
- fputs_filtered (paddress (gdbarch, addr), stream);
- fputs_filtered (" ", stream);
+ gdb_puts (paddress (gdbarch, addr), stream);
+ gdb_puts (" ", stream);
}
if (length < 0)
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 91fae3dd7f4..eb6cf7c0453 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -1060,7 +1060,7 @@ print_mem (unsigned long datum, const char *header, int in_pages_p)
{
if (in_pages_p)
datum <<= 12;
- puts_filtered (header);
+ gdb_puts (header);
if (datum > 1024)
{
printf_filtered ("%lu KB", datum >> 10);
@@ -1069,7 +1069,7 @@ print_mem (unsigned long datum, const char *header, int in_pages_p)
}
else
printf_filtered ("%lu Bytes", datum);
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
}
@@ -1137,7 +1137,7 @@ go32_sysinfo (const char *arg, int from_tty)
printf_filtered ("CPU Type.......................%s", u.machine);
if (cpuid_vendor[0])
printf_filtered (" (%s)", cpuid_vendor);
- puts_filtered ("\n");
+ gdb_puts ("\n");
/* CPUID with EAX = 1 returns processor signature and features. */
if (cpuid_max >= 1)
@@ -1262,39 +1262,39 @@ go32_sysinfo (const char *arg, int from_tty)
|| ((cpuid_edx & 1) == 0)
|| ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 0))
{
- puts_filtered ("CPU Features...................");
+ gdb_puts ("CPU Features...................");
/* We only list features which might be useful in the DPMI
environment. */
if ((cpuid_edx & 1) == 0)
- puts_filtered ("No FPU "); /* It's unusual to not have an FPU. */
+ gdb_puts ("No FPU "); /* It's unusual to not have an FPU. */
if ((cpuid_edx & (1 << 1)) != 0)
- puts_filtered ("VME ");
+ gdb_puts ("VME ");
if ((cpuid_edx & (1 << 2)) != 0)
- puts_filtered ("DE ");
+ gdb_puts ("DE ");
if ((cpuid_edx & (1 << 4)) != 0)
- puts_filtered ("TSC ");
+ gdb_puts ("TSC ");
if ((cpuid_edx & (1 << 23)) != 0)
- puts_filtered ("MMX ");
+ gdb_puts ("MMX ");
if ((cpuid_edx & (1 << 25)) != 0)
- puts_filtered ("SSE ");
+ gdb_puts ("SSE ");
if ((cpuid_edx & (1 << 26)) != 0)
- puts_filtered ("SSE2 ");
+ gdb_puts ("SSE2 ");
if (amd_p || hygon_p)
{
if ((cpuid_edx & (1 << 31)) != 0)
- puts_filtered ("3DNow! ");
+ gdb_puts ("3DNow! ");
if ((cpuid_edx & (1 << 30)) != 0)
- puts_filtered ("3DNow!Ext");
+ gdb_puts ("3DNow!Ext");
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
printf_filtered ("DOS Version....................%s %s.%s",
_os_flavor, u.release, u.version);
if (true_dos_version != advertized_dos_version)
printf_filtered (" (disguised as v%d.%d)", _osmajor, _osminor);
- puts_filtered ("\n");
+ gdb_puts ("\n");
if (!windows_major)
go32_get_windows_version ();
if (windows_major != 0xff)
@@ -1337,7 +1337,7 @@ go32_sysinfo (const char *arg, int from_tty)
else if (true_dos_version == 0x532 && advertized_dos_version == 0x500)
printf_filtered ("Windows Version................"
"Windows NT family (W2K/XP/W2K3/Vista/W2K8)\n");
- puts_filtered ("\n");
+ gdb_puts ("\n");
/* On some versions of Windows, __dpmi_get_capabilities returns
zero, but the buffer is not filled with info, so we fill the
buffer with a known pattern and test for it afterwards. */
@@ -1384,7 +1384,7 @@ go32_sysinfo (const char *arg, int from_tty)
a_tss.tss_cs & 3, (a_tss.tss_cs & 4) ? "LDT" : "GDT",
(a_tss.tss_cs & 3) > ((eflags >> 12) & 3) ? "" : "out");
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
__dpmi_get_free_memory_information (&mem_info);
print_mem (mem_info.total_number_of_physical_pages,
"DPMI Total Physical Memory.....", 1);
@@ -1542,7 +1542,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
/* Get the descriptor from the table. */
if (idx == 0 && type == 0)
- puts_filtered ("0x000: null descriptor\n");
+ gdb_puts ("0x000: null descriptor\n");
else if (get_descriptor (base_addr, idx, &descr) != -1)
{
/* For each type of descriptor table, this has a bit set if the
@@ -1580,7 +1580,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
descr.stype == 3 ? "" : "in");
break;
case 2:
- puts_filtered (" LDT");
+ gdb_puts (" LDT");
break;
case 4:
memcpy (&gate, &descr, sizeof gate);
@@ -1654,7 +1654,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
printf_filtered ("Unknown type 0x%02x", descr.stype);
break;
}
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
else if (force)
{
@@ -1662,7 +1662,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
type == 1
? idx : (idx * 8) | (type ? (cpl | 4) : 0));
if (!descr.present)
- puts_filtered ("Segment not present\n");
+ gdb_puts ("Segment not present\n");
else
printf_filtered ("Segment type 0x%02x is invalid in this table\n",
descr.stype);
@@ -1700,7 +1700,7 @@ go32_sldt (const char *arg, int from_tty)
__asm__ __volatile__ ("sldt %0" : "=m" (ldtr) : /* no inputs */ );
ldt_idx = ldtr / 8;
if (ldt_idx == 0)
- puts_filtered ("There is no LDT.\n");
+ gdb_puts ("There is no LDT.\n");
/* LDT's entry in the GDT must have the type LDT, which is 2. */
else if (get_descriptor (gdtr.base, ldt_idx, &ldt_descr) != 2)
printf_filtered ("LDT is present (at %#x), but unreadable by GDB.\n",
@@ -1941,9 +1941,9 @@ display_ptable_entry (unsigned long entry, int is_dir, int force, unsigned off)
{
printf_filtered ("Base=0x%05lx000", entry >> 12);
if ((entry & 0x100) && !is_dir)
- puts_filtered (" Global");
+ gdb_puts (" Global");
if ((entry & 0x40) && !is_dir)
- puts_filtered (" Dirty");
+ gdb_puts (" Dirty");
printf_filtered (" %sAcc.", (entry & 0x20) ? "" : "Not-");
printf_filtered (" %sCached", (entry & 0x10) ? "" : "Not-");
printf_filtered (" Write-%s", (entry & 8) ? "Thru" : "Back");
@@ -1951,7 +1951,7 @@ display_ptable_entry (unsigned long entry, int is_dir, int force, unsigned off)
printf_filtered (" Read-%s", (entry & 2) ? "Write" : "Only");
if (off)
printf_filtered (" +0x%x", off);
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
else if (force)
printf_filtered ("Page%s not present or not supported; value=0x%lx.\n",
@@ -1977,8 +1977,8 @@ go32_pde (const char *arg, int from_tty)
pdbr = get_cr3 ();
if (!pdbr)
- puts_filtered ("Access to Page Directories is "
- "not supported on this system.\n");
+ gdb_puts ("Access to Page Directories is "
+ "not supported on this system.\n");
else if (pde_idx >= 0)
display_ptable_entry (get_pde (pde_idx), 1, 1, 0);
else
@@ -2002,7 +2002,7 @@ display_page_table (long n, int force)
"Page Directory entry 0x%lx:\n", n);
for (i = 0; i < 1024; i++)
display_ptable_entry (get_pte (pde, i), 0, 0, 0);
- puts_filtered ("\n");
+ gdb_puts ("\n");
}
else if (force)
printf_filtered ("Page Table not present; value=0x%lx.\n", pde >> 1);
@@ -2027,7 +2027,7 @@ go32_pte (const char *arg, int from_tty)
pdbr = get_cr3 ();
if (!pdbr)
- puts_filtered ("Access to Page Tables is not supported on this system.\n");
+ gdb_puts ("Access to Page Tables is not supported on this system.\n");
else if (pde_idx >= 0)
display_page_table (pde_idx, 1);
else
@@ -2052,7 +2052,7 @@ go32_pte_for_address (const char *arg, int from_tty)
pdbr = get_cr3 ();
if (!pdbr)
- puts_filtered ("Access to Page Tables is not supported on this system.\n");
+ gdb_puts ("Access to Page Tables is not supported on this system.\n");
else
{
int pde_idx = (addr >> 22) & 0x3ff;
diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
index dde7882b425..c61ca1dafc4 100644
--- a/gdb/guile/scm-ports.c
+++ b/gdb/guile/scm-ports.c
@@ -202,7 +202,7 @@ fputsn_filtered (const char *s, size_t size, struct ui_file *stream)
for (i = 0; i < size; ++i)
{
if (s[i] == '\0')
- fputs_filtered ("\\000", stream);
+ gdb_puts ("\\000", stream);
else
fputc_filtered (s[i], stream);
}
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index c64e8346938..8a5c02d0adb 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -687,7 +687,7 @@ ppscm_print_string_repr (SCM printer, enum display_hint hint,
for (i = 0; i < length; ++i)
{
if (string.get ()[i] == '\0')
- fputs_filtered ("\\000", stream);
+ gdb_puts ("\\000", stream);
else
fputc_filtered (string.get ()[i], stream);
}
@@ -826,10 +826,10 @@ ppscm_print_children (SCM printer, enum display_hint hint,
if (i == 0)
{
if (!printed_nothing)
- fputs_filtered (" = ", stream);
+ gdb_puts (" = ", stream);
}
else if (! is_map || i % 2 == 0)
- fputs_filtered (pretty ? "," : ", ", stream);
+ gdb_puts (pretty ? "," : ", ", stream);
/* Skip printing children if max_depth has been reached. This check
is performed after print_string_repr and the "=" separator so that
@@ -839,7 +839,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
goto done;
else if (i == 0)
/* Print initial "{" to bookend children. */
- fputs_filtered ("{", stream);
+ gdb_puts ("{", stream);
/* In summary mode, we just want to print "= {...}" if there is
a value. */
@@ -857,7 +857,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
{
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
@@ -865,7 +865,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
}
if (is_map && i % 2 == 0)
- fputs_filtered ("[", stream);
+ gdb_puts ("[", stream);
else if (is_array)
{
/* We print the index, not whatever the child method
@@ -875,8 +875,8 @@ ppscm_print_children (SCM printer, enum display_hint hint,
}
else if (! is_map)
{
- fputs_filtered (name.get (), stream);
- fputs_filtered (" = ", stream);
+ gdb_puts (name.get (), stream);
+ gdb_puts (" = ", stream);
}
if (lsscm_is_lazy_string (v_scm))
@@ -890,7 +890,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
{
gdb::unique_xmalloc_ptr<char> output
= gdbscm_scm_to_c_string (v_scm);
- fputs_filtered (output.get (), stream);
+ gdb_puts (output.get (), stream);
}
else
{
@@ -920,7 +920,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
}
if (is_map && i % 2 == 0)
- fputs_filtered ("] = ", stream);
+ gdb_puts ("] = ", stream);
}
if (i)
@@ -929,17 +929,17 @@ ppscm_print_children (SCM printer, enum display_hint hint,
{
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream);
}
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
if (pretty)
{
- fputs_filtered ("\n", stream);
+ gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream);
}
- fputs_filtered ("}", stream);
+ gdb_puts ("}", stream);
}
done:
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 2f0b6509457..57f23c0e1d3 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -70,13 +70,13 @@ print_i387_ext (struct gdbarch *gdbarch,
fprintf_filtered (file, " %cInf", (sign ? '-' : '+'));
else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000)
/* Real Indefinite (QNaN). */
- fputs_filtered (" Real Indefinite (QNaN)", file);
+ gdb_puts (" Real Indefinite (QNaN)", file);
else if (fraction[1] & 0x40000000)
/* QNaN. */
- fputs_filtered (" QNaN", file);
+ gdb_puts (" QNaN", file);
else
/* SNaN. */
- fputs_filtered (" SNaN", file);
+ gdb_puts (" SNaN", file);
}
else if (exponent < 0x7fff && exponent > 0x0000 && integer)
/* Normal. */
@@ -88,14 +88,14 @@ print_i387_ext (struct gdbarch *gdbarch,
if (integer)
/* Pseudo-denormal. */
- fputs_filtered (" Pseudo-denormal", file);
+ gdb_puts (" Pseudo-denormal", file);
else if (fraction[0] || fraction[1])
/* Denormal. */
- fputs_filtered (" Denormal", file);
+ gdb_puts (" Denormal", file);
}
else
/* Unsupported. */
- fputs_filtered (" Unsupported", file);
+ gdb_puts (" Unsupported", file);
}
/* Print the status word STATUS. If STATUS_P is false, then STATUS
@@ -113,24 +113,24 @@ print_i387_status_word (int status_p,
}
fprintf_filtered (file, "%s", hex_string_custom (status, 4));
- fputs_filtered (" ", file);
+ gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " ");
fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " ");
fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " ");
fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " ");
fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " ");
fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " ");
- fputs_filtered (" ", file);
+ gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " ");
- fputs_filtered (" ", file);
+ gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " ");
- fputs_filtered (" ", file);
+ gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " ");
fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " ");
fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " ");
fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " ");
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
fprintf_filtered (file,
" TOP: %d\n", ((status >> 11) & 7));
@@ -151,7 +151,7 @@ print_i387_control_word (int control_p,
}
fprintf_filtered (file, "%s", hex_string_custom (control, 4));
- fputs_filtered (" ", file);
+ gdb_puts (" ", file);
fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " ");
fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " ");
fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " ");
@@ -159,39 +159,39 @@ print_i387_control_word (int control_p,
fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " ");
fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " ");
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
- fputs_filtered (" PC: ", file);
+ gdb_puts (" PC: ", file);
switch ((control >> 8) & 3)
{
case 0:
- fputs_filtered ("Single Precision (24-bits)\n", file);
+ gdb_puts ("Single Precision (24-bits)\n", file);
break;
case 1:
- fputs_filtered ("Reserved\n", file);
+ gdb_puts ("Reserved\n", file);
break;
case 2:
- fputs_filtered ("Double Precision (53-bits)\n", file);
+ gdb_puts ("Double Precision (53-bits)\n", file);
break;
case 3:
- fputs_filtered ("Extended Precision (64-bits)\n", file);
+ gdb_puts ("Extended Precision (64-bits)\n", file);
break;
}
- fputs_filtered (" RC: ", file);
+ gdb_puts (" RC: ", file);
switch ((control >> 10) & 3)
{
case 0:
- fputs_filtered ("Round to nearest\n", file);
+ gdb_puts ("Round to nearest\n", file);
break;
case 1:
- fputs_filtered ("Round down\n", file);
+ gdb_puts ("Round down\n", file);
break;
case 2:
- fputs_filtered ("Round up\n", file);
+ gdb_puts ("Round up\n", file);
break;
case 3:
- fputs_filtered ("Round toward zero\n", file);
+ gdb_puts ("Round toward zero\n", file);
break;
}
}
@@ -263,21 +263,21 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
switch (tag)
{
case 0:
- fputs_filtered ("Valid ", file);
+ gdb_puts ("Valid ", file);
break;
case 1:
- fputs_filtered ("Zero ", file);
+ gdb_puts ("Zero ", file);
break;
case 2:
- fputs_filtered ("Special ", file);
+ gdb_puts ("Special ", file);
break;
case 3:
- fputs_filtered ("Empty ", file);
+ gdb_puts ("Empty ", file);
break;
}
}
else
- fputs_filtered ("Unknown ", file);
+ gdb_puts ("Unknown ", file);
regnum = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep);
regval = get_frame_register_value (frame, regnum);
@@ -286,7 +286,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
{
const gdb_byte *raw = value_contents (regval).data ();
- fputs_filtered ("0x", file);
+ gdb_puts ("0x", file);
for (i = 9; i >= 0; i--)
fprintf_filtered (file, "%02x", raw[i]);
@@ -296,11 +296,11 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
else
fprintf_filtered (file, "%s", _("<unavailable>"));
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
}
}
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
print_i387_status_word (fstat_p, fstat, file);
print_i387_control_word (fctrl_p, fctrl, file);
fprintf_filtered (file, "Tag Word: %s\n",
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 5be234f7586..1581d64ccba 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1104,7 +1104,7 @@ jump_command (const char *arg, int from_tty)
if (from_tty)
{
printf_filtered (_("Continuing at "));
- puts_filtered (paddress (gdbarch, addr));
+ gdb_puts (paddress (gdbarch, addr));
printf_filtered (".\n");
}
@@ -1955,16 +1955,16 @@ environment_info (const char *var, int from_tty)
if (val)
{
- puts_filtered (var);
- puts_filtered (" = ");
- puts_filtered (val);
- puts_filtered ("\n");
+ gdb_puts (var);
+ gdb_puts (" = ");
+ gdb_puts (val);
+ gdb_puts ("\n");
}
else
{
- puts_filtered ("Environment variable \"");
- puts_filtered (var);
- puts_filtered ("\" not defined.\n");
+ gdb_puts ("Environment variable \"");
+ gdb_puts (var);
+ gdb_puts ("\" not defined.\n");
}
}
else
@@ -1973,8 +1973,8 @@ environment_info (const char *var, int from_tty)
for (int idx = 0; envp[idx] != NULL; ++idx)
{
- puts_filtered (envp[idx]);
- puts_filtered ("\n");
+ gdb_puts (envp[idx]);
+ gdb_puts ("\n");
}
}
}
@@ -2062,9 +2062,9 @@ static const char path_var_name[] = "PATH";
static void
path_info (const char *args, int from_tty)
{
- puts_filtered ("Executable and object file path: ");
- puts_filtered (current_inferior ()->environment.get (path_var_name));
- puts_filtered ("\n");
+ gdb_puts ("Executable and object file path: ");
+ gdb_puts (current_inferior ()->environment.get (path_var_name));
+ gdb_puts ("\n");
}
/* Add zero or more directories to the front of the execution path. */
@@ -2164,7 +2164,7 @@ default_print_one_register_info (struct ui_file *file,
}
}
- fputs_filtered (format_stream.c_str (), file);
+ gdb_puts (format_stream.c_str (), file);
fprintf_filtered (file, "\n");
}
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 580075fa16e..73a46357fe7 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -176,9 +176,9 @@ show_disable_randomization (struct ui_file *file, int from_tty,
"virtual address space is %s.\n"),
value);
else
- fputs_filtered (_("Disabling randomization of debuggee's "
- "virtual address space is unsupported on\n"
- "this platform.\n"), file);
+ gdb_puts (_("Disabling randomization of debuggee's "
+ "virtual address space is unsupported on\n"
+ "this platform.\n"), file);
}
static void
diff --git a/gdb/jit.c b/gdb/jit.c
index 9f57d521a8b..5e02c2e2eda 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -761,8 +761,8 @@ jit_bfd_try_read_symtab (struct jit_code_entry *code_entry,
(code_entry->symfile_addr, code_entry->symfile_size, gnutarget));
if (nbfd == NULL)
{
- fputs_unfiltered (_("Error opening JITed symbol file, ignoring it.\n"),
- gdb_stderr);
+ gdb_puts (_("Error opening JITed symbol file, ignoring it.\n"),
+ gdb_stderr);
return;
}
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 4baab3c80c7..e7e25b5eae6 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -580,7 +580,7 @@ info_checkpoints_command (const char *arg, int from_tty)
if (fi.num == 0)
printf_filtered (_(" (main process)"));
printf_filtered (_(" at "));
- puts_filtered (paddress (gdbarch, pc));
+ gdb_puts (paddress (gdbarch, pc));
symtab_and_line sal = find_pc_line (pc, 0);
if (sal.symtab)
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 52cdaae034b..e9cf897aa55 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -944,7 +944,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
gdb::unique_xmalloc_ptr<char> status
= target_fileio_read_stralloc (NULL, filename);
if (status)
- puts_filtered (status.get ());
+ gdb_puts (status.get ());
else
warning (_("unable to open /proc file '%s'"), filename);
}
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 487a2afa8f8..87037834cf9 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -778,7 +778,7 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
catch (const gdb_exception_error &except)
{
if (warning_pre_print)
- fputs_unfiltered (warning_pre_print, gdb_stderr);
+ gdb_puts (warning_pre_print, gdb_stderr);
exception_fprintf (gdb_stderr, except,
_("libthread_db integrity checks failed: "));
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 7673426b7a8..bc82bc5380e 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -145,9 +145,9 @@ void
m2_language::printchar (int c, struct type *type,
struct ui_file *stream) const
{
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
emitchar (c, type, stream, '\'');
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
}
/* See language.h. */
@@ -165,7 +165,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (length == 0)
{
- puts_filtered ("\"\"");
+ gdb_puts ("\"\"");
return;
}
@@ -181,7 +181,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (need_comma)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
need_comma = 0;
}
@@ -197,7 +197,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{
if (in_quotes)
{
- fputs_filtered ("\", ", stream);
+ gdb_puts ("\", ", stream);
in_quotes = 0;
}
printchar (string[i], elttype, stream);
@@ -210,7 +210,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{
if (!in_quotes)
{
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
in_quotes = 1;
}
emitchar (string[i], elttype, stream, '"');
@@ -220,10 +220,10 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
/* Terminate the quotes if necessary. */
if (in_quotes)
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
if (force_ellipses || i < length)
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
/* See language.h. */
@@ -237,7 +237,7 @@ m2_language::emitchar (int ch, struct type *chtype,
if (PRINT_LITERAL_FORM (ch))
{
if (ch == '\\' || ch == quoter)
- fputs_filtered ("\\", stream);
+ gdb_puts ("\\", stream);
fprintf_filtered (stream, "%c", ch);
}
else
@@ -245,25 +245,25 @@ m2_language::emitchar (int ch, struct type *chtype,
switch (ch)
{
case '\n':
- fputs_filtered ("\\n", stream);
+ gdb_puts ("\\n", stream);
break;
case '\b':
- fputs_filtered ("\\b", stream);
+ gdb_puts ("\\b", stream);
break;
case '\t':
- fputs_filtered ("\\t", stream);
+ gdb_puts ("\\t", stream);
break;
case '\f':
- fputs_filtered ("\\f", stream);
+ gdb_puts ("\\f", stream);
break;
case '\r':
- fputs_filtered ("\\r", stream);
+ gdb_puts ("\\r", stream);
break;
case '\033':
- fputs_filtered ("\\e", stream);
+ gdb_puts ("\\e", stream);
break;
case '\007':
- fputs_filtered ("\\a", stream);
+ gdb_puts ("\\a", stream);
break;
default:
fprintf_filtered (stream, "\\%.3o", (unsigned int) ch);
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index 7607fd753c5..ac0f9f620eb 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -179,7 +179,7 @@ void
m2_type_name (struct type *type, struct ui_file *stream)
{
if (type->name () != NULL)
- fputs_filtered (type->name (), stream);
+ gdb_puts (type->name (), stream);
}
/* m2_range - displays a Modula-2 subrange type. */
@@ -213,8 +213,8 @@ m2_typedef (struct type *type, struct ui_file *stream, int show,
{
if (type->name () != NULL)
{
- fputs_filtered (type->name (), stream);
- fputs_filtered (" = ", stream);
+ gdb_puts (type->name (), stream);
+ gdb_puts (" = ", stream);
}
m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
}
@@ -235,9 +235,9 @@ static void m2_array (struct type *type, struct ui_file *stream,
m2_print_bounds (type->index_type (), stream, show, -1, 1);
}
else
- fputs_filtered (pulongest ((TYPE_LENGTH (type)
- / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))),
- stream);
+ gdb_puts (pulongest ((TYPE_LENGTH (type)
+ / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))),
+ stream);
}
fprintf_filtered (stream, "] OF ");
m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
@@ -291,7 +291,7 @@ m2_procedure (struct type *type, struct ui_file *stream,
{
if (i > 0)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
stream->wrap_here (4);
}
m2_print_type (type->field (i).type (), "", stream, -1, 0, flags);
@@ -442,10 +442,10 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level,
{
if (type->name () != NULL)
{
- fputs_filtered (type->name (), stream);
+ gdb_puts (type->name (), stream);
if (show == 0)
return 1;
- fputs_filtered (" = ", stream);
+ gdb_puts (" = ", stream);
}
if (get_long_set_bounds (type, &low, &high))
@@ -516,7 +516,7 @@ m2_unbounded_array (struct type *type, struct ui_file *stream, int show,
{
if (show > 0)
{
- fputs_filtered ("ARRAY OF ", stream);
+ gdb_puts ("ARRAY OF ", stream);
m2_print_type (TYPE_TARGET_TYPE (type->field (0).type ()),
"", stream, 0, level, flags);
}
@@ -534,7 +534,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
{
if (!startswith (type->name (), "$$"))
{
- fputs_filtered (type->name (), stream);
+ gdb_puts (type->name (), stream);
if (show > 0)
fprintf_filtered (stream, " = ");
}
@@ -565,7 +565,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
print_spaces_filtered (level + 4, stream);
fputs_styled (type->field (i).name (),
variable_name_style.style (), stream);
- fputs_filtered (" : ", stream);
+ gdb_puts (" : ", stream);
m2_print_type (type->field (i).type (),
"",
stream, 0, level + 4, flags);
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 3fd46b25a38..3fe9ad83b70 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -200,7 +200,7 @@ print_unpacked_pointer (struct type *type,
if (options->addressprint && options->format != 's')
{
- fputs_filtered (paddress (gdbarch, address), stream);
+ gdb_puts (paddress (gdbarch, address), stream);
want_space = 1;
}
@@ -213,7 +213,7 @@ print_unpacked_pointer (struct type *type,
&& addr != 0)
{
if (want_space)
- fputs_filtered (" ", stream);
+ gdb_puts (" ", stream);
return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
stream, options);
}
@@ -233,7 +233,7 @@ print_variable_at_address (struct type *type,
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
fprintf_filtered (stream, "[");
- fputs_filtered (paddress (gdbarch, addr), stream);
+ gdb_puts (paddress (gdbarch, addr), stream);
fprintf_filtered (stream, "] : ");
if (elttype->code () != TYPE_CODE_UNDEF)
@@ -244,7 +244,7 @@ print_variable_at_address (struct type *type,
common_val_print (deref_val, stream, recurse, options, current_language);
}
else
- fputs_filtered ("???", stream);
+ gdb_puts ("???", stream);
}
@@ -397,7 +397,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
int i;
int need_comma = 0;
- fputs_filtered ("{", stream);
+ gdb_puts ("{", stream);
i = get_discrete_bounds (range, &low_bound, &high_bound) ? 0 : -1;
maybe_bad_bstring:
@@ -420,7 +420,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
if (element)
{
if (need_comma)
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
print_type_scalar (range, i, stream);
need_comma = 1;
@@ -429,7 +429,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
{
int j = i;
- fputs_filtered ("..", stream);
+ gdb_puts ("..", stream);
while (i + 1 <= high_bound
&& value_bit_index (type, valaddr, ++i))
j = i;
@@ -438,7 +438,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
}
}
done:
- fputs_filtered ("}", stream);
+ gdb_puts ("}", stream);
}
break;
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 07714644fca..e1caeefdff9 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -41,7 +41,7 @@ static struct cmd_list_element *macrolist;
static void
macro_inform_no_debuginfo (void)
{
- puts_filtered ("GDB has no preprocessor macro information for that code.\n");
+ gdb_puts ("GDB has no preprocessor macro information for that code.\n");
}
static void
@@ -63,9 +63,9 @@ macro_expand_command (const char *exp, int from_tty)
{
gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
- puts_filtered ("expands to: ");
- puts_filtered (expanded.get ());
- puts_filtered ("\n");
+ gdb_puts ("expands to: ");
+ gdb_puts (expanded.get ());
+ gdb_puts ("\n");
}
else
macro_inform_no_debuginfo ();
@@ -91,9 +91,9 @@ macro_expand_once_command (const char *exp, int from_tty)
{
gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
- puts_filtered ("expands to: ");
- puts_filtered (expanded.get ());
- puts_filtered ("\n");
+ gdb_puts ("expands to: ");
+ gdb_puts (expanded.get ());
+ gdb_puts ("\n");
}
else
macro_inform_no_debuginfo ();
@@ -117,7 +117,7 @@ show_pp_source_pos (struct ui_file *stream,
while (file->included_by)
{
fullname = macro_source_fullname (file->included_by);
- fputs_filtered (_(" included at "), stream);
+ gdb_puts (_(" included at "), stream);
fputs_styled (fullname.c_str (), file_name_style.style (), stream);
fprintf_filtered (stream, ":%d\n", file->included_at_line);
file = file->included_by;
@@ -149,14 +149,14 @@ print_macro_definition (const char *name,
{
int i;
- puts_filtered ("(");
+ gdb_puts ("(");
for (i = 0; i < d->argc; i++)
{
- puts_filtered (d->argv[i]);
+ gdb_puts (d->argv[i]);
if (i + 1 < d->argc)
- puts_filtered (", ");
+ gdb_puts (", ");
}
- puts_filtered (")");
+ gdb_puts (")");
}
if (line != 0)
diff --git a/gdb/main.c b/gdb/main.c
index 73fdff25018..081a984552b 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1394,12 +1394,12 @@ print_gdb_help (struct ui_file *stream)
/* Note: The options in the list below are only approximately sorted
in the alphabetical order, so as to group closely related options
together. */
- fputs_unfiltered (_("\
+ gdb_puts (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
- fputs_unfiltered (_("\
+ gdb_puts (_("\
Selection of debuggee and its files:\n\n\
--args Arguments after executable-file are passed to inferior.\n\
--core=COREFILE Analyze the core dump COREFILE.\n\
@@ -1412,7 +1412,7 @@ Selection of debuggee and its files:\n\n\
--readnever Do not read symbol files.\n\
--write Set writing into executable and core files.\n\n\
"), stream);
- fputs_unfiltered (_("\
+ gdb_puts (_("\
Initial commands and command files:\n\n\
--command=FILE, -x Execute GDB commands from FILE.\n\
--init-command=FILE, -ix\n\
@@ -1426,7 +1426,7 @@ Initial commands and command files:\n\n\
--nh Do not read ~/.gdbinit.\n\
--nx Do not read any .gdbinit files in any directory.\n\n\
"), stream);
- fputs_unfiltered (_("\
+ gdb_puts (_("\
Output and user interface control:\n\n\
--fullname Output information used by emacs-GDB interface.\n\
--interpreter=INTERP\n\
@@ -1436,16 +1436,16 @@ Output and user interface control:\n\n\
--nw Do not use the GUI interface.\n\
"), stream);
#if defined(TUI)
- fputs_unfiltered (_("\
+ gdb_puts (_("\
--tui Use a terminal user interface.\n\
"), stream);
#endif
- fputs_unfiltered (_("\
+ gdb_puts (_("\
--dbx DBX compatibility mode.\n\
-q, --quiet, --silent\n\
Do not print version number on startup.\n\n\
"), stream);
- fputs_unfiltered (_("\
+ gdb_puts (_("\
Operating modes:\n\n\
--batch Exit after processing options.\n\
--batch-silent Like --batch, but suppress all gdb stdout output.\n\
@@ -1462,7 +1462,7 @@ Other options:\n\n\
--data-directory=DIR, -D\n\
Set GDB's data-directory to DIR.\n\
"), stream);
- fputs_unfiltered (_("\n\
+ gdb_puts (_("\n\
At startup, GDB reads the following early init files and executes their\n\
commands:\n\
"), stream);
@@ -1473,7 +1473,7 @@ commands:\n\
if (home_gdbearlyinit.empty ())
fprintf_unfiltered (stream, _("\
None found.\n"));
- fputs_unfiltered (_("\n\
+ gdb_puts (_("\n\
At startup, GDB reads the following init files and executes their commands:\n\
"), stream);
if (!system_gdbinit.empty ())
@@ -1501,7 +1501,7 @@ At startup, GDB reads the following init files and executes their commands:\n\
&& local_gdbinit.empty ())
fprintf_unfiltered (stream, _("\
None found.\n"));
- fputs_unfiltered (_("\n\
+ gdb_puts (_("\n\
For more information, type \"help\" from within GDB, or consult the\n\
GDB manual (available as on-line info or a printed manual).\n\
"), stream);
diff --git a/gdb/maint-test-options.c b/gdb/maint-test-options.c
index 09175c3a3cf..d9d7e0a225a 100644
--- a/gdb/maint-test-options.c
+++ b/gdb/maint-test-options.c
@@ -279,7 +279,7 @@ static void
maintenance_show_test_options_completion_result (const char *args,
int from_tty)
{
- puts_filtered (maintenance_test_options_command_completion_text.c_str ());
+ gdb_puts (maintenance_test_options_command_completion_text.c_str ());
}
/* Save the completion result in the global variables read by the
diff --git a/gdb/maint.c b/gdb/maint.c
index 11dc2e466d6..de3e07e5b5f 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -363,7 +363,7 @@ static void
maint_print_all_sections (const char *header, bfd *abfd, objfile *objfile,
const char *arg)
{
- puts_filtered (header);
+ gdb_puts (header);
gdb_stdout->wrap_here (8);
printf_filtered ("`%s', ", bfd_get_filename (abfd));
gdb_stdout->wrap_here (8);
diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py
index 97178072a37..a68315d7ffa 100755
--- a/gdb/make-target-delegates.py
+++ b/gdb/make-target-delegates.py
@@ -269,16 +269,16 @@ def write_debugmethod(f, content, name, return_type, argtypes):
)
for i in range(len(argtypes)):
if i > 0:
- print(' fputs_unfiltered (", ", gdb_stdlog);', file=f)
+ print(' gdb_puts (", ", gdb_stdlog);', file=f)
printer = munge_type(argtypes[i])
print(" " + printer + " (" + names[i] + ");", file=f)
if return_type != "void":
- print(' fputs_unfiltered (") = ", gdb_stdlog);', file=f)
+ print(' gdb_puts (") = ", gdb_stdlog);', file=f)
printer = munge_type(return_type)
print(" " + printer + " (result);", file=f)
- print(' fputs_unfiltered ("\\n", gdb_stdlog);', file=f)
+ print(' gdb_puts ("\\n", gdb_stdlog);', file=f)
else:
- print(' fputs_unfiltered (")\\n", gdb_stdlog);', file=f)
+ print(' gdb_puts (")\\n", gdb_stdlog);', file=f)
if return_type != "void":
print(" return result;", file=f)
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index 9db87fe180c..5043e9b475d 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -76,7 +76,7 @@ mi_console_file::flush ()
size_t length_buf = str.size ();
const char *buf = str.data ();
- fputs_unfiltered (m_prefix, m_raw);
+ gdb_puts (m_prefix, m_raw);
if (m_quote)
{
fputc_unfiltered (m_quote, m_raw);
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 2c47024d5e6..4da45185604 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -98,7 +98,7 @@ display_mi_prompt (struct mi_interp *mi)
{
struct ui *ui = current_ui;
- fputs_unfiltered ("(gdb) \n", mi->raw_stdout);
+ gdb_puts ("(gdb) \n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
ui->prompt_state = PROMPTED;
}
@@ -674,11 +674,11 @@ mi_on_normal_stop_1 (struct bpstat *bs, int print_frame)
mi_uiout->field_signed ("core", core);
}
- fputs_unfiltered ("*stopped", mi->raw_stdout);
+ gdb_puts ("*stopped", mi->raw_stdout);
mi_out_put (mi_uiout, mi->raw_stdout);
mi_out_rewind (mi_uiout);
mi_print_timing_maybe (mi->raw_stdout);
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
}
@@ -1018,7 +1018,7 @@ mi_on_resume_1 (struct mi_interp *mi,
even if it cannot actually accept any input. This will be
surely removed for MI3, and may be removed even earlier. */
if (current_ui->prompt_state == PROMPT_BLOCKED)
- fputs_unfiltered ("(gdb) \n", mi->raw_stdout);
+ gdb_puts ("(gdb) \n", mi->raw_stdout);
}
gdb_flush (mi->raw_stdout);
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 91eb8d1edd8..ff46af546ca 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -153,8 +153,8 @@ mi_cmd_gdb_exit (const char *command, char **argv, int argc)
/* We have to print everything right here because we never return. */
if (current_token)
- fputs_unfiltered (current_token, mi->raw_stdout);
- fputs_unfiltered ("^exit\n", mi->raw_stdout);
+ gdb_puts (current_token, mi->raw_stdout);
+ gdb_puts ("^exit\n", mi->raw_stdout);
mi_out_put (current_uiout, mi->raw_stdout);
gdb_flush (mi->raw_stdout);
/* FIXME: The function called is not yet a formal libgdb function. */
@@ -1830,15 +1830,15 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
uiout will most likely crash in the mi_out_* routines. */
if (!running_result_record_printed)
{
- fputs_unfiltered (context->token, mi->raw_stdout);
+ gdb_puts (context->token, mi->raw_stdout);
/* There's no particularly good reason why target-connect results
in not ^done. Should kill ^connected for MI3. */
- fputs_unfiltered (strcmp (context->command, "target-select") == 0
- ? "^connected" : "^done", mi->raw_stdout);
+ gdb_puts (strcmp (context->command, "target-select") == 0
+ ? "^connected" : "^done", mi->raw_stdout);
mi_out_put (uiout, mi->raw_stdout);
mi_out_rewind (uiout);
mi_print_timing_maybe (mi->raw_stdout);
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
}
else
/* The command does not want anything to be printed. In that
@@ -1869,12 +1869,12 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
{
if (!running_result_record_printed)
{
- fputs_unfiltered (context->token, mi->raw_stdout);
- fputs_unfiltered ("^done", mi->raw_stdout);
+ gdb_puts (context->token, mi->raw_stdout);
+ gdb_puts ("^done", mi->raw_stdout);
mi_out_put (uiout, mi->raw_stdout);
mi_out_rewind (uiout);
mi_print_timing_maybe (mi->raw_stdout);
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
}
else
mi_out_rewind (uiout);
@@ -1891,22 +1891,22 @@ mi_print_exception (const char *token, const struct gdb_exception &exception)
{
struct mi_interp *mi = (struct mi_interp *) current_interpreter ();
- fputs_unfiltered (token, mi->raw_stdout);
- fputs_unfiltered ("^error,msg=\"", mi->raw_stdout);
+ gdb_puts (token, mi->raw_stdout);
+ gdb_puts ("^error,msg=\"", mi->raw_stdout);
if (exception.message == NULL)
- fputs_unfiltered ("unknown error", mi->raw_stdout);
+ gdb_puts ("unknown error", mi->raw_stdout);
else
mi->raw_stdout->putstr (exception.what (), '"');
- fputs_unfiltered ("\"", mi->raw_stdout);
+ gdb_puts ("\"", mi->raw_stdout);
switch (exception.error)
{
case UNDEFINED_COMMAND_ERROR:
- fputs_unfiltered (",code=\"undefined-command\"", mi->raw_stdout);
+ gdb_puts (",code=\"undefined-command\"", mi->raw_stdout);
break;
}
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
}
void
@@ -2187,8 +2187,8 @@ mi_load_progress (const char *section_name,
previous_sect_name = xstrdup (section_name);
if (current_token)
- fputs_unfiltered (current_token, mi->raw_stdout);
- fputs_unfiltered ("+download", mi->raw_stdout);
+ gdb_puts (current_token, mi->raw_stdout);
+ gdb_puts ("+download", mi->raw_stdout);
{
ui_out_emit_tuple tuple_emitter (uiout.get (), NULL);
uiout->field_string ("section", section_name);
@@ -2196,7 +2196,7 @@ mi_load_progress (const char *section_name,
uiout->field_signed ("total-size", grand_total);
}
mi_out_put (uiout.get (), mi->raw_stdout);
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
}
@@ -2205,8 +2205,8 @@ mi_load_progress (const char *section_name,
{
last_update = time_now;
if (current_token)
- fputs_unfiltered (current_token, mi->raw_stdout);
- fputs_unfiltered ("+download", mi->raw_stdout);
+ gdb_puts (current_token, mi->raw_stdout);
+ gdb_puts ("+download", mi->raw_stdout);
{
ui_out_emit_tuple tuple_emitter (uiout.get (), NULL);
uiout->field_string ("section", section_name);
@@ -2216,7 +2216,7 @@ mi_load_progress (const char *section_name,
uiout->field_signed ("total-size", grand_total);
}
mi_out_put (uiout.get (), mi->raw_stdout);
- fputs_unfiltered ("\n", mi->raw_stdout);
+ gdb_puts ("\n", mi->raw_stdout);
gdb_flush (mi->raw_stdout);
}
}
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 5145bea4b75..ff93cb3ba10 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -150,9 +150,9 @@ mi_ui_out::do_field_fmt (int fldno, int width, ui_align align,
if (fldname)
fprintf_unfiltered (stream, "%s=\"", fldname);
else
- fputs_unfiltered ("\"", stream);
+ gdb_puts ("\"", stream);
gdb_vprintf (stream, format, args);
- fputs_unfiltered ("\"", stream);
+ gdb_puts ("\"", stream);
}
void
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 20e12b6889e..3756f9883dc 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -508,7 +508,7 @@ mips_show_dr (const char *func, CORE_ADDR addr,
{
int i;
- fputs_unfiltered (func, gdb_stdlog);
+ gdb_puts (func, gdb_stdlog);
if (addr || len)
fprintf_unfiltered (gdb_stdlog,
" (addr=%s, len=%d, type=%s)",
@@ -518,7 +518,7 @@ mips_show_dr (const char *func, CORE_ADDR addr,
: (type == hw_access ? "data-read/write"
: (type == hw_execute ? "instruction-execute"
: "??unknown??"))));
- fputs_unfiltered (":\n", gdb_stdlog);
+ gdb_puts (":\n", gdb_stdlog);
for (i = 0; i < MAX_DEBUG_REGISTER; i++)
fprintf_unfiltered (gdb_stdlog, "\tDR%d: lo=%s, hi=%s\n", i,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 5cd72ae2451..d731ecc4938 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6391,7 +6391,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
val = get_frame_register_value (frame, regnum);
- fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);
+ gdb_puts (gdbarch_register_name (gdbarch, regnum), file);
/* The problem with printing numeric register names (r26, etc.) is that
the user can't use them on input. Probably the best solution is to
@@ -6412,17 +6412,17 @@ static void
print_fpu_flags (struct ui_file *file, int flags)
{
if (flags & (1 << 0))
- fputs_filtered (" inexact", file);
+ gdb_puts (" inexact", file);
if (flags & (1 << 1))
- fputs_filtered (" uflow", file);
+ gdb_puts (" uflow", file);
if (flags & (1 << 2))
- fputs_filtered (" oflow", file);
+ gdb_puts (" oflow", file);
if (flags & (1 << 3))
- fputs_filtered (" div0", file);
+ gdb_puts (" div0", file);
if (flags & (1 << 4))
- fputs_filtered (" inval", file)[...]
[diff truncated at 100000 bytes]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-29 19:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 19:42 [binutils-gdb] Unify gdb puts functions Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).