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.
This commit is contained in:
Tom Tromey 2022-01-02 11:36:44 -07:00
parent 19a7b8ab87
commit 0426ad513f
86 changed files with 1196 additions and 1204 deletions

View file

@ -885,7 +885,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
if (name != NULL && name[0] != '\0') if (name != NULL && name[0] != '\0')
{ {
fputs_filtered (" ", stream); gdb_puts (" ", stream);
fputs_styled (name, function_name_style.style (), 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) if (i > 0)
{ {
fputs_filtered ("; ", stream); gdb_puts ("; ", stream);
stream->wrap_here (4); stream->wrap_here (4);
} }
fprintf_filtered (stream, "a%d: ", i + 1); fprintf_filtered (stream, "a%d: ", i + 1);

View file

@ -317,7 +317,7 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
/* Don't try to modify a result representing an error. */ /* Don't try to modify a result representing an error. */
if (s[0] == '<') if (s[0] == '<')
{ {
fputs_filtered (s.c_str (), stream); gdb_puts (s.c_str (), stream);
return; return;
} }
@ -362,9 +362,9 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
void void
ada_printchar (int c, struct type *type, struct ui_file *stream) 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)); 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 /* [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) if (length == 0)
{ {
fputs_filtered ("\"\"", stream); gdb_puts ("\"\"", stream);
return; return;
} }
@ -482,7 +482,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
if (need_comma) if (need_comma)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
need_comma = 0; need_comma = 0;
} }
@ -500,13 +500,13 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
{ {
if (in_quotes) if (in_quotes)
{ {
fputs_filtered ("\", ", stream); gdb_puts ("\", ", stream);
in_quotes = 0; in_quotes = 0;
} }
fputs_filtered ("'", stream); gdb_puts ("'", stream);
ada_emit_char (char_at (string, i, type_len, byte_order), ada_emit_char (char_at (string, i, type_len, byte_order),
elttype, stream, '\'', type_len); elttype, stream, '\'', type_len);
fputs_filtered ("'", stream); gdb_puts ("'", stream);
fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"), fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"),
metadata_style.style ().ptr (), reps, nullptr); metadata_style.style ().ptr (), reps, nullptr);
i = rep1 - 1; i = rep1 - 1;
@ -517,7 +517,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
{ {
if (!in_quotes) if (!in_quotes)
{ {
fputs_filtered ("\"", stream); gdb_puts ("\"", stream);
in_quotes = 1; in_quotes = 1;
} }
ada_emit_char (char_at (string, i, type_len, byte_order), 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. */ /* Terminate the quotes if necessary. */
if (in_quotes) if (in_quotes)
fputs_filtered ("\"", stream); gdb_puts ("\"", stream);
if (force_ellipses || i < length) if (force_ellipses || i < length)
fputs_filtered ("...", stream); gdb_puts ("...", stream);
} }
void void
@ -633,7 +633,7 @@ print_field_values (struct value *value, struct value *outer_value,
ada_name_prefix_len (type->field (i).name ()), ada_name_prefix_len (type->field (i).name ()),
type->field (i).name ()); type->field (i).name ());
annotate_field_name_end (); annotate_field_name_end ();
fputs_filtered (" => ", stream); gdb_puts (" => ", stream);
annotate_field_value (); annotate_field_value ();
if (TYPE_FIELD_PACKED (type, i)) 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_TARGET_TYPE (value_type (val))->code () == TYPE_CODE_INT
&& TYPE_LENGTH (TYPE_TARGET_TYPE (value_type (val))) == 0) && TYPE_LENGTH (TYPE_TARGET_TYPE (value_type (val))) == 0)
{ {
fputs_filtered ("null", stream); gdb_puts ("null", stream);
return; return;
} }
@ -802,7 +802,7 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
fprintf_filtered (stream, "("); fprintf_filtered (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); fprintf_filtered (stream, ") ");
fputs_filtered (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
} }
else else
{ {
@ -811,7 +811,7 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
{ {
LONGEST c; LONGEST c;
fputs_filtered (" ", stream); gdb_puts (" ", stream);
c = unpack_long (type, valaddr); c = unpack_long (type, valaddr);
ada_printchar (c, type, stream); 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); deref_val_int = unpack_pointer (type, valaddr + offset_aligned);
if (deref_val_int == 0) if (deref_val_int == 0)
{ {
fputs_filtered ("(null)", stream); gdb_puts ("(null)", stream);
return; return;
} }

View file

@ -4015,15 +4015,15 @@ static void
print_fpu_flags (struct ui_file *file, int flags) print_fpu_flags (struct ui_file *file, int flags)
{ {
if (flags & (1 << 0)) if (flags & (1 << 0))
fputs_filtered ("IVO ", file); gdb_puts ("IVO ", file);
if (flags & (1 << 1)) if (flags & (1 << 1))
fputs_filtered ("DVZ ", file); gdb_puts ("DVZ ", file);
if (flags & (1 << 2)) if (flags & (1 << 2))
fputs_filtered ("OFL ", file); gdb_puts ("OFL ", file);
if (flags & (1 << 3)) if (flags & (1 << 3))
fputs_filtered ("UFL ", file); gdb_puts ("UFL ", file);
if (flags & (1 << 4)) if (flags & (1 << 4))
fputs_filtered ("INX ", file); gdb_puts ("INX ", file);
fputc_filtered ('\n', file); fputc_filtered ('\n', file);
} }
@ -4042,10 +4042,10 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
else else
fprintf_filtered (file, _("Software FPU type %d\n"), type); fprintf_filtered (file, _("Software FPU type %d\n"), type);
/* i18n: [floating point unit] mask */ /* i18n: [floating point unit] mask */
fputs_filtered (_("mask: "), file); gdb_puts (_("mask: "), file);
print_fpu_flags (file, status >> 16); print_fpu_flags (file, status >> 16);
/* i18n: [floating point unit] flags */ /* i18n: [floating point unit] flags */
fputs_filtered (_("flags: "), file); gdb_puts (_("flags: "), file);
print_fpu_flags (file, status); print_fpu_flags (file, status);
} }

View file

@ -398,7 +398,7 @@ ax_print (struct ui_file *f, struct agent_expr *x)
fprintf_filtered (f, "%3d %s", i, aop_map[op].name); fprintf_filtered (f, "%3d %s", i, aop_map[op].name);
if (aop_map[op].op_size > 0) if (aop_map[op].op_size > 0)
{ {
fputs_filtered (" ", f); gdb_puts (" ", f);
print_longest (f, 'd', 0, print_longest (f, 'd', 0,
read_const (x, i + 1, aop_map[op].op_size)); read_const (x, i + 1, aop_map[op].op_size));

View file

@ -206,13 +206,13 @@ c_printstr (struct ui_file *stream, struct type *type,
case C_STRING: case C_STRING:
break; break;
case C_WIDE_STRING: case C_WIDE_STRING:
fputs_filtered ("L", stream); gdb_puts ("L", stream);
break; break;
case C_STRING_16: case C_STRING_16:
fputs_filtered ("u", stream); gdb_puts ("u", stream);
break; break;
case C_STRING_32: case C_STRING_32:
fputs_filtered ("U", stream); gdb_puts ("U", stream);
break; break;
} }

View file

@ -91,7 +91,7 @@ print_name_maybe_canonical (const char *name,
find_typedef_for_canonicalize, find_typedef_for_canonicalize,
(void *) flags); (void *) flags);
fputs_filtered (s != nullptr ? s.get () : name, stream); gdb_puts (s != nullptr ? s.get () : name, stream);
} }
@ -120,9 +120,9 @@ c_print_type_1 (struct type *type,
if (local_name != NULL) if (local_name != NULL)
{ {
c_type_print_modifier (type, stream, 0, 1, language); c_type_print_modifier (type, stream, 0, 1, language);
fputs_filtered (local_name, stream); gdb_puts (local_name, stream);
if (varstring != NULL && *varstring != '\0') if (varstring != NULL && *varstring != '\0')
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
else else
{ {
@ -138,7 +138,7 @@ c_print_type_1 (struct type *type,
|| code == TYPE_CODE_MEMBERPTR || code == TYPE_CODE_MEMBERPTR
|| code == TYPE_CODE_METHODPTR || code == TYPE_CODE_METHODPTR
|| TYPE_IS_REFERENCE (type)))) || TYPE_IS_REFERENCE (type))))
fputs_filtered (" ", stream); gdb_puts (" ", stream);
need_post_space = (varstring != NULL && strcmp (varstring, "") != 0); need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
c_type_print_varspec_prefix (type, stream, show, 0, need_post_space, c_type_print_varspec_prefix (type, stream, show, 0, need_post_space,
language, flags, podata); 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++) for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{ {
stream->wrap_here (8); stream->wrap_here (8);
fputs_filtered (i == 0 ? ": " : ", ", stream); gdb_puts (i == 0 ? ": " : ", ", stream);
fprintf_filtered (stream, "%s%s ", fprintf_filtered (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i) BASETYPE_VIA_PUBLIC (type, i)
? "public" : (TYPE_FIELD_PROTECTED (type, i) ? "public" : (TYPE_FIELD_PROTECTED (type, i)
@ -265,7 +265,7 @@ cp_type_print_derivation_info (struct ui_file *stream,
} }
if (i > 0) 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); language_cplus, DMGL_ANSI);
fprintf_symbol_filtered (stream, varstring, fprintf_symbol_filtered (stream, varstring,
language_cplus, DMGL_ANSI); language_cplus, DMGL_ANSI);
fputs_filtered ("(", stream); gdb_puts ("(", stream);
/* Skip the class variable. We keep this here to accommodate older /* Skip the class variable. We keep this here to accommodate older
compilers and debug formats which may not support artificial 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 else
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (9); stream->wrap_here (9);
fprintf_filtered (stream, "%s = ", sym->linkage_name ()); fprintf_filtered (stream, "%s = ", sym->linkage_name ());
} }
@ -903,7 +903,7 @@ c_type_print_template_args (const struct type_print_options *flags,
} }
if (!first) if (!first)
fputs_filtered (_("] "), stream); gdb_puts (_("] "), stream);
} }
/* Use 'print_spaces_filtered', but take into consideration the /* 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. */ here. */
print_name_maybe_canonical (type->name (), flags, stream); print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0) if (show > 0)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
if (show < 0) 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)), (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, -1, 0, language, &local_flags, podata); "", stream, -1, 0, language, &local_flags, podata);
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
if (TYPE_FN_FIELD_STUB (f, j)) 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; int length = p - demangled_no_class;
std::string demangled_no_static (demangled_no_class, std::string demangled_no_static (demangled_no_class,
length); length);
fputs_filtered (demangled_no_static.c_str (), stream); gdb_puts (demangled_no_static.c_str (), stream);
} }
else else
fputs_filtered (demangled_no_class, stream); gdb_puts (demangled_no_class, stream);
} }
fprintf_filtered (stream, ";\n"); 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); print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0) if (show > 0)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
stream->wrap_here (4); 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); print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0) if (show > 0)
{ {
fputs_filtered (" ", stream); gdb_puts (" ", stream);
fprintf_filtered (stream, "{\n"); fprintf_filtered (stream, "{\n");
if (type->num_fields () == 0) if (type->num_fields () == 0)
{ {
@ -1684,8 +1684,8 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
break; break;
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
fputs_filtered ("namespace ", stream); gdb_puts ("namespace ", stream);
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
break; break;
default: default:

View file

@ -158,7 +158,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
demangle); demangle);
else if (options->addressprint) else if (options->addressprint)
{ {
fputs_filtered (paddress (gdbarch, address), stream); gdb_puts (paddress (gdbarch, address), stream);
want_space = 1; want_space = 1;
} }
@ -169,7 +169,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
&& address != 0) && address != 0)
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
val_print_string (unresolved_elttype, NULL, address, -1, stream, options); val_print_string (unresolved_elttype, NULL, address, -1, stream, options);
} }
else if (cp_is_vtbl_member (type)) 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))) && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
fputs_filtered (" <", stream); gdb_puts (" <", stream);
fputs_filtered (msymbol.minsym->print_name (), stream); gdb_puts (msymbol.minsym->print_name (), stream);
fputs_filtered (">", stream); gdb_puts (">", stream);
want_space = 1; want_space = 1;
} }
@ -199,7 +199,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
struct type *wtype; struct type *wtype;
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
if (msymbol.minsym != NULL) 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 (); const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (c_textual_element_type (type, options->format)) if (c_textual_element_type (type, options->format))
{ {
fputs_filtered (" ", stream); gdb_puts (" ", stream);
current_language->printchar (unpack_long (type, valaddr), type, current_language->printchar (unpack_long (type, valaddr), type,
stream); stream);
} }

View file

@ -221,9 +221,9 @@ cli_ui_out::do_text (const char *string)
return; return;
if (test_flags (unfiltered_output)) if (test_flags (unfiltered_output))
fputs_unfiltered (string, m_streams.back ()); gdb_puts (string, m_streams.back ());
else else
fputs_filtered (string, m_streams.back ()); gdb_puts (string, m_streams.back ());
} }
void void

View file

@ -1355,7 +1355,7 @@ fput_alias_definition_styled (const cmd_list_element &c,
struct ui_file *stream) struct ui_file *stream)
{ {
gdb_assert (c.is_alias ()); gdb_assert (c.is_alias ());
fputs_filtered (" alias ", stream); gdb_puts (" alias ", stream);
fput_command_name_styled (c, stream); fput_command_name_styled (c, stream);
fprintf_filtered (stream, " = "); fprintf_filtered (stream, " = ");
fput_command_name_styled (*c.alias_target, 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)) if (!print_alias (alias))
continue; continue;
fputs_filtered (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (3); stream->wrap_here (3);
fput_command_name_styled (alias, stream); fput_command_name_styled (alias, stream);
} }
if (print_something) if (print_something)
fputs_filtered (postfix, stream); gdb_puts (postfix, stream);
} }
/* If VERBOSE, print the full help for command C and highlight the /* 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 this documentation from the previous command help, in the likely
case that apropos finds several commands. */ case that apropos finds several commands. */
if (verbose) if (verbose)
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
fput_command_names_styled (c, true, fput_command_names_styled (c, true,
verbose ? "" : " -- ", stream); verbose ? "" : " -- ", stream);
if (verbose) if (verbose)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
fput_aliases_definition_styled (c, stream); fput_aliases_definition_styled (c, stream);
fputs_highlighted (c.doc, highlight, stream); fputs_highlighted (c.doc, highlight, stream);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
else else
{ {
print_doc_line (stream, c.doc, false); print_doc_line (stream, c.doc, false);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
fput_aliases_definition_styled (c, 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. */ the false indicates to not output the (single) command name. */
fput_command_names_styled (*c, false, "\n", stream); fput_command_names_styled (*c, false, "\n", stream);
fput_aliases_definition_styled (*c, stream); fput_aliases_definition_styled (*c, stream);
fputs_filtered (c->doc, stream); gdb_puts (c->doc, stream);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
if (!c->is_prefix () && !c->is_command_class_help ()) if (!c->is_prefix () && !c->is_command_class_help ())
return; return;
@ -1661,17 +1661,17 @@ Type \"help all\" for the list of all commands.");
fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ", fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",
cmdtype1, cmdtype2); cmdtype1, cmdtype2);
stream->wrap_here (0); stream->wrap_here (0);
fputs_filtered ("for ", stream); gdb_puts ("for ", stream);
stream->wrap_here (0); stream->wrap_here (0);
fputs_filtered ("full ", stream); gdb_puts ("full ", stream);
stream->wrap_here (0); stream->wrap_here (0);
fputs_filtered ("documentation.\n", stream); gdb_puts ("documentation.\n", stream);
fputs_filtered ("Type \"apropos word\" to search " gdb_puts ("Type \"apropos word\" to search "
"for commands related to \"word\".\n", stream); "for commands related to \"word\".\n", stream);
fputs_filtered ("Type \"apropos -v word\" for full documentation", stream); gdb_puts ("Type \"apropos -v word\" for full documentation", stream);
stream->wrap_here (0); stream->wrap_here (0);
fputs_filtered (" of commands related to \"word\".\n", stream); gdb_puts (" of commands related to \"word\".\n", stream);
fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n", gdb_puts ("Command name abbreviations are allowed if unambiguous.\n",
stream); stream);
} }
@ -1756,7 +1756,7 @@ print_doc_line (struct ui_file *stream, const char *str,
} }
else else
line_buffer[p - str] = '\0'; line_buffer[p - str] = '\0';
fputs_filtered (line_buffer, stream); gdb_puts (line_buffer, stream);
} }
/* Print one-line help for command C. /* 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); fput_command_names_styled (c, true, " -- ", stream);
print_doc_line (stream, c.doc, false); print_doc_line (stream, c.doc, false);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
if (!c.default_args.empty ()) if (!c.default_args.empty ())
fput_alias_definition_styled (c, stream); fput_alias_definition_styled (c, stream);
fput_aliases_definition_styled (c, stream); fput_aliases_definition_styled (c, stream);

View file

@ -433,7 +433,7 @@ restore_one_section (bfd *ibfd, asection *isec,
(unsigned long) sec_start + sec_offset (unsigned long) sec_start + sec_offset
+ load_offset + sec_load_count)); + load_offset + sec_load_count));
else else
puts_filtered ("\n"); gdb_puts ("\n");
/* Write the data. */ /* Write the data. */
ret = target_write_memory (sec_start + sec_offset + load_offset, ret = target_write_memory (sec_start + sec_offset + load_offset,

View file

@ -503,7 +503,7 @@ print_command_trace (const char *fmt, ...)
va_start (args, fmt); va_start (args, fmt);
gdb_vprintf (fmt, args); gdb_vprintf (fmt, args);
va_end (args); va_end (args);
puts_filtered ("\n"); gdb_puts ("\n");
} }
/* Helper for execute_control_command. */ /* 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) if (cmdlines)
{ {
print_command_lines (current_uiout, cmdlines, 1); print_command_lines (current_uiout, cmdlines, 1);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
} }

View file

@ -187,7 +187,7 @@ do_show (const char *what, struct ui_file *file,
const char *value) const char *value)
{ {
cli_style_option *cso = (cli_style_option *) cmd->context (); 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_styled (file, cso->style (), _("\"%s\" style"), cso->name ());
fprintf_filtered (file, _(" %s is: %s\n"), what, value); fprintf_filtered (file, _(" %s is: %s\n"), what, value);
} }

View file

@ -167,14 +167,14 @@ print_one_macro (const char *name, const struct macro_definition *macro,
{ {
int i; int i;
fputs_filtered ("(", file); gdb_puts ("(", file);
for (i = 0; i < macro->argc; i++) for (i = 0; i < macro->argc; i++)
{ {
fputs_filtered (macro->argv[i], file); gdb_puts (macro->argv[i], file);
if (i + 1 < macro->argc) 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); fprintf_filtered (file, " %s\n#endif\n", macro->replacement);
@ -218,7 +218,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
int i; int i;
int seen = 0; int seen = 0;
fputs_unfiltered ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n", gdb_puts ("struct " COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG " {\n",
stream); stream);
if (!registers_used.empty ()) if (!registers_used.empty ())
@ -241,7 +241,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
register types (typically flags or vectors), emit a register types (typically flags or vectors), emit a
maximally-aligned array of the correct size. */ maximally-aligned array of the correct size. */
fputs_unfiltered (" ", stream); gdb_puts (" ", stream);
switch (regtype->code ()) switch (regtype->code ())
{ {
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
@ -257,7 +257,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
if (mode != NULL) if (mode != NULL)
{ {
if (regtype->is_unsigned ()) if (regtype->is_unsigned ())
fputs_unfiltered ("unsigned ", stream); gdb_puts ("unsigned ", stream);
fprintf_unfiltered (stream, fprintf_unfiltered (stream,
"int %s" "int %s"
" __attribute__ ((__mode__(__%s__)))", " __attribute__ ((__mode__(__%s__)))",
@ -277,15 +277,15 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
regname.c_str (), regname.c_str (),
pulongest (TYPE_LENGTH (regtype))); pulongest (TYPE_LENGTH (regtype)));
} }
fputs_unfiltered (";\n", stream); gdb_puts (";\n", stream);
} }
} }
if (!seen) if (!seen)
fputs_unfiltered (" char " COMPILE_I_SIMPLE_REGISTER_DUMMY ";\n", gdb_puts (" char " COMPILE_I_SIMPLE_REGISTER_DUMMY ";\n",
stream); stream);
fputs_unfiltered ("};\n\n", stream); gdb_puts ("};\n\n", stream);
} }
/* C-language policy to emit a push user expression pragma into BUF. */ /* 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) 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,7 +320,7 @@ struct c_add_code_header
switch (type) switch (type)
{ {
case COMPILE_I_SIMPLE_SCOPE: case COMPILE_I_SIMPLE_SCOPE:
fputs_unfiltered ("void " gdb_puts ("void "
GCC_FE_WRAPPER_FUNCTION GCC_FE_WRAPPER_FUNCTION
" (struct " " (struct "
COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
@ -333,7 +333,7 @@ struct c_add_code_header
case COMPILE_I_PRINT_ADDRESS_SCOPE: case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE: case COMPILE_I_PRINT_VALUE_SCOPE:
/* <string.h> is needed for a memcpy call below. */ /* <string.h> is needed for a memcpy call below. */
fputs_unfiltered ("#include <string.h>\n" gdb_puts ("#include <string.h>\n"
"void " "void "
GCC_FE_WRAPPER_FUNCTION GCC_FE_WRAPPER_FUNCTION
" (struct " " (struct "
@ -369,7 +369,7 @@ struct c_add_code_footer
case COMPILE_I_SIMPLE_SCOPE: case COMPILE_I_SIMPLE_SCOPE:
case COMPILE_I_PRINT_ADDRESS_SCOPE: case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE: case COMPILE_I_PRINT_VALUE_SCOPE:
fputs_unfiltered ("}\n", buf); gdb_puts ("}\n", buf);
break; break;
case COMPILE_I_RAW_SCOPE: case COMPILE_I_RAW_SCOPE:
@ -405,10 +405,10 @@ struct c_add_input
break; break;
default: default:
fputs_unfiltered (input, buf); gdb_puts (input, buf);
break; 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) 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) 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,7 +444,7 @@ struct cplus_add_code_header
switch (type) switch (type)
{ {
case COMPILE_I_SIMPLE_SCOPE: case COMPILE_I_SIMPLE_SCOPE:
fputs_unfiltered ("void " gdb_puts ("void "
GCC_FE_WRAPPER_FUNCTION GCC_FE_WRAPPER_FUNCTION
" (struct " " (struct "
COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
@ -456,7 +456,7 @@ struct cplus_add_code_header
case COMPILE_I_PRINT_ADDRESS_SCOPE: case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE: case COMPILE_I_PRINT_VALUE_SCOPE:
fputs_unfiltered ( gdb_puts (
"#include <cstring>\n" "#include <cstring>\n"
"#include <bits/move.h>\n" "#include <bits/move.h>\n"
"void " "void "
@ -512,10 +512,10 @@ struct cplus_add_input
break; break;
default: default:
fputs_unfiltered (input, buf); gdb_puts (input, buf);
break; break;
} }
fputs_unfiltered ("\n", buf); gdb_puts ("\n", buf);
} }
}; };

View file

@ -1246,9 +1246,9 @@ static void
compile_cplus_debug_output_1 (const char *arg) compile_cplus_debug_output_1 (const char *arg)
{ {
if (arg == nullptr) if (arg == nullptr)
fputs_unfiltered ("NULL", gdb_stdlog); gdb_puts ("NULL", gdb_stdlog);
else else
fputs_unfiltered (arg, gdb_stdlog); gdb_puts (arg, gdb_stdlog);
} }
static void static void
@ -1275,7 +1275,7 @@ compile_cplus_debug_output (T arg, Targs... Args)
#define OUTPUT_DEBUG_RESULT(R) \ #define OUTPUT_DEBUG_RESULT(R) \
if (debug_compile_cplus_types) \ if (debug_compile_cplus_types) \
{ \ { \
fputs_unfiltered (": ", gdb_stdlog); \ gdb_puts (": ", gdb_stdlog); \
compile_cplus_debug_output (R); \ compile_cplus_debug_output (R); \
fputc_unfiltered ('\n', gdb_stdlog); \ fputc_unfiltered ('\n', gdb_stdlog); \
} \ } \

View file

@ -647,7 +647,7 @@ get_args (const compile_instance *compiler, struct gdbarch *gdbarch)
static void static void
print_callback (void *ignore, const char *message) 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 /* Process the compilation request. On success it returns the object

View file

@ -50,9 +50,9 @@ complaint_internal (const char *fmt, ...)
(*deprecated_warning_hook) (fmt, args); (*deprecated_warning_hook) (fmt, args);
else else
{ {
fputs_filtered (_("During symbol reading: "), gdb_stderr); gdb_puts (_("During symbol reading: "), gdb_stderr);
gdb_vprintf (gdb_stderr, fmt, args); gdb_vprintf (gdb_stderr, fmt, args);
fputs_filtered ("\n", gdb_stderr); gdb_puts ("\n", gdb_stderr);
} }
va_end (args); va_end (args);

View file

@ -198,9 +198,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (fields_seen) if (fields_seen)
{ {
fputs_filtered (",", stream); gdb_puts (",", stream);
if (!options->prettyformat) if (!options->prettyformat)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
else if (n_baseclasses > 0) else if (n_baseclasses > 0)
{ {
@ -208,9 +208,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
{ {
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream); gdb_puts ("members of ", stream);
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (":", stream); gdb_puts (":", stream);
} }
} }
fields_seen = 1; 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))) if (field_is_static (&type->field (i)))
{ {
fputs_filtered ("static ", stream); gdb_puts ("static ", stream);
fprintf_symbol_filtered (stream, fprintf_symbol_filtered (stream,
type->field (i).name (), type->field (i).name (),
current_language->la_language, 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 /* Do not print leading '=' in case of anonymous
unions. */ unions. */
if (strcmp (type->field (i).name (), "")) if (strcmp (type->field (i).name (), ""))
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
else else
{ {
/* If this is an anonymous field then we want to consider it /* 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"); fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream); 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 /* Not sure what the best notation is in the case where there is
no baseclass name. */ no baseclass name. */
fputs_filtered (basename ? basename : "", stream); gdb_puts (basename ? basename : "", stream);
fputs_filtered ("> = ", stream); gdb_puts ("> = ", stream);
if (skip < 0) if (skip < 0)
val_print_unavailable (stream); val_print_unavailable (stream);
@ -516,7 +516,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
0); 0);
} }
} }
fputs_filtered (", ", stream); gdb_puts (", ", stream);
flush_it: flush_it:
; ;
@ -701,10 +701,10 @@ cp_print_class_member (const gdb_byte *valaddr, struct type *type,
{ {
const char *name; const char *name;
fputs_filtered (prefix, stream); gdb_puts (prefix, stream);
name = self_type->name (); name = self_type->name ();
if (name) if (name)
fputs_filtered (name, stream); gdb_puts (name, stream);
else else
c_type_print_base (self_type, stream, 0, 0, &type_print_raw_options); c_type_print_base (self_type, stream, 0, 0, &type_print_raw_options);
fprintf_filtered (stream, "::"); fprintf_filtered (stream, "::");

View file

@ -1122,7 +1122,7 @@ show_disassembler_options_sfunc (struct ui_file *file, int from_tty,
if (valid_options_and_args == NULL) if (valid_options_and_args == NULL)
{ {
fputs_filtered (_("There are no disassembler options available " gdb_puts (_("There are no disassembler options available "
"for this architecture.\n"), "for this architecture.\n"),
file); file);
return; return;

View file

@ -917,7 +917,7 @@ chain_candidate (struct gdbarch *gdbarch,
fprintf_unfiltered (gdb_stdlog, "tailcall: reduced:"); fprintf_unfiltered (gdb_stdlog, "tailcall: reduced:");
for (idx = 0; idx < (*resultp)->callers; idx++) for (idx = 0; idx < (*resultp)->callers; idx++)
tailcall_dump (gdbarch, (*resultp)->call_site[idx]); tailcall_dump (gdbarch, (*resultp)->call_site[idx]);
fputs_unfiltered (" |", gdb_stdlog); gdb_puts (" |", gdb_stdlog);
for (idx = 0; idx < (*resultp)->callees; idx++) for (idx = 0; idx < (*resultp)->callees; idx++)
tailcall_dump (gdbarch, tailcall_dump (gdbarch,
(*resultp)->call_site[(*resultp)->length (*resultp)->call_site[(*resultp)->length

View file

@ -23094,7 +23094,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
case DW_FORM_addrx: case DW_FORM_addrx:
case DW_FORM_GNU_addr_index: case DW_FORM_GNU_addr_index:
fprintf_unfiltered (f, "address: "); 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; break;
case DW_FORM_block2: case DW_FORM_block2:
case DW_FORM_block4: case DW_FORM_block4:
@ -23112,11 +23112,11 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
break; break;
case DW_FORM_ref_addr: case DW_FORM_ref_addr:
fprintf_unfiltered (f, "ref address: "); 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; break;
case DW_FORM_GNU_ref_alt: case DW_FORM_GNU_ref_alt:
fprintf_unfiltered (f, "alt ref address: "); 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; break;
case DW_FORM_ref1: case DW_FORM_ref1:
case DW_FORM_ref2: case DW_FORM_ref2:

View file

@ -1236,7 +1236,7 @@ async_disconnect (gdb_client_data arg)
catch (const gdb_exception &exception) catch (const gdb_exception &exception)
{ {
fputs_filtered ("Could not kill the program being debugged", gdb_puts ("Could not kill the program being debugged",
gdb_stderr); gdb_stderr);
exception_print (gdb_stderr, exception); exception_print (gdb_stderr, exception);
} }

View file

@ -81,7 +81,7 @@ print_exception (struct ui_file *file, const struct gdb_exception &e)
{ {
end = strchr (start, '\n'); end = strchr (start, '\n');
if (end == NULL) if (end == NULL)
fputs_filtered (start, file); gdb_puts (start, file);
else else
{ {
end++; end++;

View file

@ -980,7 +980,7 @@ exec_target::files_info ()
print_section_info (&current_program_space->target_sections (), print_section_info (&current_program_space->target_sections (),
current_program_space->exec_bfd ()); current_program_space->exec_bfd ());
else else
puts_filtered (_("\t<no file loaded>\n")); gdb_puts (_("\t<no file loaded>\n"));
} }
static void static void

View file

@ -138,9 +138,9 @@ dump_for_expression (struct ui_file *stream, int depth,
{ {
fprintf_filtered (stream, _("%*sType flags: "), depth, ""); fprintf_filtered (stream, _("%*sType flags: "), depth, "");
if (flags & TYPE_INSTANCE_FLAG_CONST) if (flags & TYPE_INSTANCE_FLAG_CONST)
fputs_filtered ("const ", stream); gdb_puts ("const ", stream);
if (flags & TYPE_INSTANCE_FLAG_VOLATILE) if (flags & TYPE_INSTANCE_FLAG_VOLATILE)
fputs_filtered ("volatile", stream); gdb_puts ("volatile", stream);
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
} }
@ -152,24 +152,24 @@ dump_for_expression (struct ui_file *stream, int depth,
switch (flags & ~C_CHAR) switch (flags & ~C_CHAR)
{ {
case C_WIDE_STRING: case C_WIDE_STRING:
fputs_filtered (_("wide "), stream); gdb_puts (_("wide "), stream);
break; break;
case C_STRING_16: case C_STRING_16:
fputs_filtered (_("u16 "), stream); gdb_puts (_("u16 "), stream);
break; break;
case C_STRING_32: case C_STRING_32:
fputs_filtered (_("u32 "), stream); gdb_puts (_("u32 "), stream);
break; break;
default: default:
fputs_filtered (_("ordinary "), stream); gdb_puts (_("ordinary "), stream);
break; break;
} }
if ((flags & C_CHAR) != 0) if ((flags & C_CHAR) != 0)
fputs_filtered (_("char"), stream); gdb_puts (_("char"), stream);
else else
fputs_filtered (_("string"), stream); gdb_puts (_("string"), stream);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
void void
@ -178,13 +178,13 @@ dump_for_expression (struct ui_file *stream, int depth,
{ {
fprintf_filtered (stream, _("%*sRange:"), depth, ""); fprintf_filtered (stream, _("%*sRange:"), depth, "");
if ((flags & RANGE_LOW_BOUND_DEFAULT) != 0) if ((flags & RANGE_LOW_BOUND_DEFAULT) != 0)
fputs_filtered (_("low-default "), stream); gdb_puts (_("low-default "), stream);
if ((flags & RANGE_HIGH_BOUND_DEFAULT) != 0) if ((flags & RANGE_HIGH_BOUND_DEFAULT) != 0)
fputs_filtered (_("high-default "), stream); gdb_puts (_("high-default "), stream);
if ((flags & RANGE_HIGH_BOUND_EXCLUSIVE) != 0) if ((flags & RANGE_HIGH_BOUND_EXCLUSIVE) != 0)
fputs_filtered (_("high-exclusive "), stream); gdb_puts (_("high-exclusive "), stream);
if ((flags & RANGE_HAS_STRIDE) != 0) if ((flags & RANGE_HAS_STRIDE) != 0)
fputs_filtered (_("has-stride"), stream); gdb_puts (_("has-stride"), stream);
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
} }

View file

@ -161,9 +161,9 @@ public:
void printchar (int ch, struct type *chtype, void printchar (int ch, struct type *chtype,
struct ui_file *stream) const override struct ui_file *stream) const override
{ {
fputs_filtered ("'", stream); gdb_puts ("'", stream);
emitchar (ch, chtype, stream, '\''); emitchar (ch, chtype, stream, '\'');
fputs_filtered ("'", stream); gdb_puts ("'", stream);
} }
/* See language.h. */ /* See language.h. */
@ -176,7 +176,7 @@ public:
const char *type_encoding = get_encoding (elttype); const char *type_encoding = get_encoding (elttype);
if (TYPE_LENGTH (elttype) == 4) if (TYPE_LENGTH (elttype) == 4)
fputs_filtered ("4_", stream); gdb_puts ("4_", stream);
if (!encoding || !*encoding) if (!encoding || !*encoding)
encoding = type_encoding; encoding = type_encoding;

View file

@ -69,14 +69,14 @@ f_language::print_type (struct type *type, const char *varstring,
== TYPE_CODE_METHOD) == TYPE_CODE_METHOD)
|| (TYPE_TARGET_TYPE (type)->code () || (TYPE_TARGET_TYPE (type)->code ()
== TYPE_CODE_ARRAY)))))) == TYPE_CODE_ARRAY))))))
fputs_filtered (" ", stream); gdb_puts (" ", stream);
f_type_print_varspec_prefix (type, stream, show, 0); f_type_print_varspec_prefix (type, stream, show, 0);
if (varstring != NULL) if (varstring != NULL)
{ {
int demangled_args; int demangled_args;
fputs_filtered (varstring, stream); gdb_puts (varstring, stream);
/* For demangled function names, we have the arglist as part of the name, /* For demangled function names, we have the arglist as part of the name,
so don't print an additional pair of ()'s. */ 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); 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) if (i > 0)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (4); stream->wrap_here (4);
} }
print_type (type->field (i).type (), "", stream, -1, 0, 0); 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, ""); fprintf_filtered (stream, "%*sType, C_Union :: ", level, "");
else else
fprintf_filtered (stream, "%*sType ", level, ""); fprintf_filtered (stream, "%*sType ", level, "");
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
/* According to the definition, /* According to the definition,
we only print structure elements in case show > 0. */ we only print structure elements in case show > 0. */
if (show > 0) if (show > 0)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
for (index = 0; index < type->num_fields (); index++) for (index = 0; index < type->num_fields (); index++)
{ {
f_type_print_base (type->field (index).type (), stream, f_type_print_base (type->field (index).type (), stream,
show - 1, level + 4); show - 1, level + 4);
fputs_filtered (" :: ", stream); gdb_puts (" :: ", stream);
fputs_styled (type->field (index).name (), fputs_styled (type->field (index).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
f_type_print_varspec_suffix (type->field (index).type (), f_type_print_varspec_suffix (type->field (index).type (),
stream, show - 1, 0, 0, 0, false); stream, show - 1, 0, 0, 0, false);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
fprintf_filtered (stream, "%*sEnd Type ", level, ""); fprintf_filtered (stream, "%*sEnd Type ", level, "");
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
} }
break; break;

View file

@ -144,7 +144,7 @@ public:
{ {
bool cont = should_continue && (m_elts < m_options->print_max); bool cont = should_continue && (m_elts < m_options->print_max);
if (!cont && should_continue) if (!cont && should_continue)
fputs_filtered ("...", m_stream); gdb_puts ("...", m_stream);
return cont; return cont;
} }
@ -162,7 +162,7 @@ public:
m_stats[dim_indx].nelts = nelts; 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 /* 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. */ separators between elements, and dimensions of the array. */
void finish_dimension (bool inner_p, bool last_p) void finish_dimension (bool inner_p, bool last_p)
{ {
fputs_filtered (")", m_stream); gdb_puts (")", m_stream);
if (!last_p) if (!last_p)
fputs_filtered (" ", m_stream); gdb_puts (" ", m_stream);
m_dimension--; m_dimension--;
} }
@ -218,7 +218,7 @@ public:
nullptr); nullptr);
annotate_elt_rep_end (); annotate_elt_rep_end ();
if (!repeated) if (!repeated)
fputs_filtered (" ", m_stream); gdb_puts (" ", m_stream);
m_elts += nrepeats * m_stats[dim_indx + 1].nelts; m_elts += nrepeats * m_stats[dim_indx + 1].nelts;
} }
else else
@ -245,7 +245,7 @@ public:
nrepeats++; nrepeats++;
} }
else if (last_p) 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, common_val_print (e_val, m_stream, m_recurse, m_options,
current_language); current_language);
if (i > 1) if (i > 1)
fputs_filtered (", ", m_stream); gdb_puts (", ", m_stream);
} }
} }
printed = true; printed = true;
@ -314,14 +314,14 @@ public:
= value_from_component (m_val, elt_type, elt_off); = value_from_component (m_val, elt_type, elt_off);
if (printed) if (printed)
fputs_filtered (", ", m_stream); gdb_puts (", ", m_stream);
maybe_print_array_index (m_stats[dim_indx].index_type, index, maybe_print_array_index (m_stats[dim_indx].index_type, index,
m_stream, m_options); m_stream, m_options);
common_val_print (e_val, m_stream, m_recurse, m_options, common_val_print (e_val, m_stream, m_recurse, m_options,
current_language); current_language);
} }
if (!last_p) if (!last_p)
fputs_filtered (", ", m_stream); gdb_puts (", ", m_stream);
} }
m_elt_type_prev = elt_type; m_elt_type_prev = elt_type;
@ -490,7 +490,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
stream, demangle); stream, demangle);
else if (options->addressprint && options->format != 's') else if (options->addressprint && options->format != 's')
{ {
fputs_filtered (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
want_space = 1; want_space = 1;
} }
@ -502,7 +502,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
&& addr != 0) && addr != 0)
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1, val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
stream, options); stream, options);
} }
@ -542,13 +542,13 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
field = value_field (val, index); field = value_field (val, index);
if (printed_field > 0) if (printed_field > 0)
fputs_filtered (", ", stream); gdb_puts (", ", stream);
if (field_name != NULL) if (field_name != NULL)
{ {
fputs_styled (field_name, variable_name_style.style (), fputs_styled (field_name, variable_name_style.style (),
stream); stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
common_val_print (field, stream, recurse + 1, 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 represented. Different compilers use different non zero
values to represent logical true. */ values to represent logical true. */
if (longval == 0) if (longval == 0)
fputs_filtered (f_decorations.false_name, stream); gdb_puts (f_decorations.false_name, stream);
else else
fputs_filtered (f_decorations.true_name, stream); gdb_puts (f_decorations.true_name, stream);
} }
break; break;

View file

@ -4888,7 +4888,7 @@ print_bit_vector (B_TYPE *bits, int nbits)
{ {
if ((bitno % 8) == 0) if ((bitno % 8) == 0)
{ {
puts_filtered (" "); gdb_puts (" ");
} }
if (B_TST (bits, bitno)) if (B_TST (bits, bitno))
printf_filtered (("1")); printf_filtered (("1"));
@ -5019,7 +5019,7 @@ print_cplus_stuff (struct type *type, int spaces)
print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type), print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type),
TYPE_N_BASECLASSES (type)); TYPE_N_BASECLASSES (type));
puts_filtered ("\n"); gdb_puts ("\n");
} }
if (type->num_fields () > 0) 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))); host_address_to_string (TYPE_FIELD_PRIVATE_BITS (type)));
print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type), print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type),
type->num_fields ()); type->num_fields ());
puts_filtered ("\n"); gdb_puts ("\n");
} }
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL) 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))); host_address_to_string (TYPE_FIELD_PROTECTED_BITS (type)));
print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type), print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type),
type->num_fields ()); type->num_fields ());
puts_filtered ("\n"); gdb_puts ("\n");
} }
} }
if (TYPE_NFN_FIELDS (type) > 0) if (TYPE_NFN_FIELDS (type) > 0)
@ -5223,7 +5223,7 @@ recursive_dump_type (struct type *type, int spaces)
printf_filtered ("(UNKNOWN TYPE CODE)"); printf_filtered ("(UNKNOWN TYPE CODE)");
break; break;
} }
puts_filtered ("\n"); gdb_puts ("\n");
printf_filtered ("%*slength %s\n", spaces, "", printf_filtered ("%*slength %s\n", spaces, "",
pulongest (TYPE_LENGTH (type))); pulongest (TYPE_LENGTH (type)));
if (type->is_objfile_owned ()) if (type->is_objfile_owned ())
@ -5248,87 +5248,87 @@ recursive_dump_type (struct type *type, int spaces)
(unsigned) type->instance_flags ()); (unsigned) type->instance_flags ());
if (TYPE_CONST (type)) if (TYPE_CONST (type))
{ {
puts_filtered (" TYPE_CONST"); gdb_puts (" TYPE_CONST");
} }
if (TYPE_VOLATILE (type)) if (TYPE_VOLATILE (type))
{ {
puts_filtered (" TYPE_VOLATILE"); gdb_puts (" TYPE_VOLATILE");
} }
if (TYPE_CODE_SPACE (type)) if (TYPE_CODE_SPACE (type))
{ {
puts_filtered (" TYPE_CODE_SPACE"); gdb_puts (" TYPE_CODE_SPACE");
} }
if (TYPE_DATA_SPACE (type)) if (TYPE_DATA_SPACE (type))
{ {
puts_filtered (" TYPE_DATA_SPACE"); gdb_puts (" TYPE_DATA_SPACE");
} }
if (TYPE_ADDRESS_CLASS_1 (type)) if (TYPE_ADDRESS_CLASS_1 (type))
{ {
puts_filtered (" TYPE_ADDRESS_CLASS_1"); gdb_puts (" TYPE_ADDRESS_CLASS_1");
} }
if (TYPE_ADDRESS_CLASS_2 (type)) if (TYPE_ADDRESS_CLASS_2 (type))
{ {
puts_filtered (" TYPE_ADDRESS_CLASS_2"); gdb_puts (" TYPE_ADDRESS_CLASS_2");
} }
if (TYPE_RESTRICT (type)) if (TYPE_RESTRICT (type))
{ {
puts_filtered (" TYPE_RESTRICT"); gdb_puts (" TYPE_RESTRICT");
} }
if (TYPE_ATOMIC (type)) if (TYPE_ATOMIC (type))
{ {
puts_filtered (" TYPE_ATOMIC"); gdb_puts (" TYPE_ATOMIC");
} }
puts_filtered ("\n"); gdb_puts ("\n");
printf_filtered ("%*sflags", spaces, ""); printf_filtered ("%*sflags", spaces, "");
if (type->is_unsigned ()) if (type->is_unsigned ())
{ {
puts_filtered (" TYPE_UNSIGNED"); gdb_puts (" TYPE_UNSIGNED");
} }
if (type->has_no_signedness ()) if (type->has_no_signedness ())
{ {
puts_filtered (" TYPE_NOSIGN"); gdb_puts (" TYPE_NOSIGN");
} }
if (type->endianity_is_not_default ()) if (type->endianity_is_not_default ())
{ {
puts_filtered (" TYPE_ENDIANITY_NOT_DEFAULT"); gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
} }
if (type->is_stub ()) if (type->is_stub ())
{ {
puts_filtered (" TYPE_STUB"); gdb_puts (" TYPE_STUB");
} }
if (type->target_is_stub ()) if (type->target_is_stub ())
{ {
puts_filtered (" TYPE_TARGET_STUB"); gdb_puts (" TYPE_TARGET_STUB");
} }
if (type->is_prototyped ()) if (type->is_prototyped ())
{ {
puts_filtered (" TYPE_PROTOTYPED"); gdb_puts (" TYPE_PROTOTYPED");
} }
if (type->has_varargs ()) if (type->has_varargs ())
{ {
puts_filtered (" TYPE_VARARGS"); gdb_puts (" TYPE_VARARGS");
} }
/* This is used for things like AltiVec registers on ppc. Gcc emits /* This is used for things like AltiVec registers on ppc. Gcc emits
an attribute for the array type, which tells whether or not we an attribute for the array type, which tells whether or not we
have a vector, instead of a regular array. */ have a vector, instead of a regular array. */
if (type->is_vector ()) if (type->is_vector ())
{ {
puts_filtered (" TYPE_VECTOR"); gdb_puts (" TYPE_VECTOR");
} }
if (type->is_fixed_instance ()) if (type->is_fixed_instance ())
{ {
puts_filtered (" TYPE_FIXED_INSTANCE"); gdb_puts (" TYPE_FIXED_INSTANCE");
} }
if (type->stub_is_supported ()) if (type->stub_is_supported ())
{ {
puts_filtered (" TYPE_STUB_SUPPORTED"); gdb_puts (" TYPE_STUB_SUPPORTED");
} }
if (TYPE_NOTTEXT (type)) 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 ()); printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ());
if (TYPE_ASSOCIATED_PROP (type) != nullptr if (TYPE_ASSOCIATED_PROP (type) != nullptr
|| TYPE_ALLOCATED_PROP (type) != nullptr) || TYPE_ALLOCATED_PROP (type) != nullptr)
@ -5396,10 +5396,10 @@ recursive_dump_type (struct type *type, int spaces)
printf_filtered ("%*sfloatformat ", spaces, ""); printf_filtered ("%*sfloatformat ", spaces, "");
if (TYPE_FLOATFORMAT (type) == NULL if (TYPE_FLOATFORMAT (type) == NULL
|| TYPE_FLOATFORMAT (type)->name == NULL) || TYPE_FLOATFORMAT (type)->name == NULL)
puts_filtered ("(null)"); gdb_puts ("(null)");
else else
puts_filtered (TYPE_FLOATFORMAT (type)->name); gdb_puts (TYPE_FLOATFORMAT (type)->name);
puts_filtered ("\n"); gdb_puts ("\n");
break; break;
case TYPE_SPECIFIC_FUNC: case TYPE_SPECIFIC_FUNC:
@ -5416,7 +5416,7 @@ recursive_dump_type (struct type *type, int spaces)
case TYPE_SPECIFIC_FIXED_POINT: case TYPE_SPECIFIC_FIXED_POINT:
printf_filtered ("%*sfixed_point_info ", spaces, ""); printf_filtered ("%*sfixed_point_info ", spaces, "");
print_fixed_point_type_info (type, spaces); print_fixed_point_type_info (type, spaces);
puts_filtered ("\n"); gdb_puts ("\n");
break; break;
case TYPE_SPECIFIC_INT: case TYPE_SPECIFIC_INT:

View file

@ -649,18 +649,18 @@ gnuv3_print_method_ptr (const gdb_byte *contents,
fprintf_filtered (stream, "&virtual "); fprintf_filtered (stream, "&virtual ");
if (demangled_name == NULL) if (demangled_name == NULL)
fputs_filtered (physname, stream); gdb_puts (physname, stream);
else else
fputs_filtered (demangled_name.get (), stream); gdb_puts (demangled_name.get (), stream);
return; return;
} }
} }
else if (ptr_value != 0) else if (ptr_value != 0)
{ {
/* Found a non-virtual function: print out the type. */ /* 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); 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. */ /* We didn't find it; print the raw data. */

View file

@ -54,7 +54,7 @@ go_language::print_type (struct type *type, const char *varstring,
if (type->code () == TYPE_CODE_ARRAY if (type->code () == TYPE_CODE_ARRAY
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR) && TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR)
{ {
fputs_filtered ("string", stream); gdb_puts ("string", stream);
return; return;
} }

View file

@ -66,8 +66,8 @@ print_go_string (struct type *type,
/* TODO(dje): Print address of struct or actual string? */ /* TODO(dje): Print address of struct or actual string? */
if (options->addressprint) if (options->addressprint)
{ {
fputs_filtered (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
if (length < 0) if (length < 0)

View file

@ -1060,7 +1060,7 @@ print_mem (unsigned long datum, const char *header, int in_pages_p)
{ {
if (in_pages_p) if (in_pages_p)
datum <<= 12; datum <<= 12;
puts_filtered (header); gdb_puts (header);
if (datum > 1024) if (datum > 1024)
{ {
printf_filtered ("%lu KB", datum >> 10); printf_filtered ("%lu KB", datum >> 10);
@ -1069,7 +1069,7 @@ print_mem (unsigned long datum, const char *header, int in_pages_p)
} }
else else
printf_filtered ("%lu Bytes", datum); 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); printf_filtered ("CPU Type.......................%s", u.machine);
if (cpuid_vendor[0]) if (cpuid_vendor[0])
printf_filtered (" (%s)", cpuid_vendor); printf_filtered (" (%s)", cpuid_vendor);
puts_filtered ("\n"); gdb_puts ("\n");
/* CPUID with EAX = 1 returns processor signature and features. */ /* CPUID with EAX = 1 returns processor signature and features. */
if (cpuid_max >= 1) if (cpuid_max >= 1)
@ -1262,39 +1262,39 @@ go32_sysinfo (const char *arg, int from_tty)
|| ((cpuid_edx & 1) == 0) || ((cpuid_edx & 1) == 0)
|| ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 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 /* We only list features which might be useful in the DPMI
environment. */ environment. */
if ((cpuid_edx & 1) == 0) 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) if ((cpuid_edx & (1 << 1)) != 0)
puts_filtered ("VME "); gdb_puts ("VME ");
if ((cpuid_edx & (1 << 2)) != 0) if ((cpuid_edx & (1 << 2)) != 0)
puts_filtered ("DE "); gdb_puts ("DE ");
if ((cpuid_edx & (1 << 4)) != 0) if ((cpuid_edx & (1 << 4)) != 0)
puts_filtered ("TSC "); gdb_puts ("TSC ");
if ((cpuid_edx & (1 << 23)) != 0) if ((cpuid_edx & (1 << 23)) != 0)
puts_filtered ("MMX "); gdb_puts ("MMX ");
if ((cpuid_edx & (1 << 25)) != 0) if ((cpuid_edx & (1 << 25)) != 0)
puts_filtered ("SSE "); gdb_puts ("SSE ");
if ((cpuid_edx & (1 << 26)) != 0) if ((cpuid_edx & (1 << 26)) != 0)
puts_filtered ("SSE2 "); gdb_puts ("SSE2 ");
if (amd_p || hygon_p) if (amd_p || hygon_p)
{ {
if ((cpuid_edx & (1 << 31)) != 0) if ((cpuid_edx & (1 << 31)) != 0)
puts_filtered ("3DNow! "); gdb_puts ("3DNow! ");
if ((cpuid_edx & (1 << 30)) != 0) 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", printf_filtered ("DOS Version....................%s %s.%s",
_os_flavor, u.release, u.version); _os_flavor, u.release, u.version);
if (true_dos_version != advertized_dos_version) if (true_dos_version != advertized_dos_version)
printf_filtered (" (disguised as v%d.%d)", _osmajor, _osminor); printf_filtered (" (disguised as v%d.%d)", _osmajor, _osminor);
puts_filtered ("\n"); gdb_puts ("\n");
if (!windows_major) if (!windows_major)
go32_get_windows_version (); go32_get_windows_version ();
if (windows_major != 0xff) 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) else if (true_dos_version == 0x532 && advertized_dos_version == 0x500)
printf_filtered ("Windows Version................" printf_filtered ("Windows Version................"
"Windows NT family (W2K/XP/W2K3/Vista/W2K8)\n"); "Windows NT family (W2K/XP/W2K3/Vista/W2K8)\n");
puts_filtered ("\n"); gdb_puts ("\n");
/* On some versions of Windows, __dpmi_get_capabilities returns /* On some versions of Windows, __dpmi_get_capabilities returns
zero, but the buffer is not filled with info, so we fill the zero, but the buffer is not filled with info, so we fill the
buffer with a known pattern and test for it afterwards. */ 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, (a_tss.tss_cs & 4) ? "LDT" : "GDT",
(a_tss.tss_cs & 3) > ((eflags >> 12) & 3) ? "" : "out"); (a_tss.tss_cs & 3) > ((eflags >> 12) & 3) ? "" : "out");
} }
puts_filtered ("\n"); gdb_puts ("\n");
__dpmi_get_free_memory_information (&mem_info); __dpmi_get_free_memory_information (&mem_info);
print_mem (mem_info.total_number_of_physical_pages, print_mem (mem_info.total_number_of_physical_pages,
"DPMI Total Physical Memory.....", 1); "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. */ /* Get the descriptor from the table. */
if (idx == 0 && type == 0) 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) else if (get_descriptor (base_addr, idx, &descr) != -1)
{ {
/* For each type of descriptor table, this has a bit set if the /* 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"); descr.stype == 3 ? "" : "in");
break; break;
case 2: case 2:
puts_filtered (" LDT"); gdb_puts (" LDT");
break; break;
case 4: case 4:
memcpy (&gate, &descr, sizeof gate); 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); printf_filtered ("Unknown type 0x%02x", descr.stype);
break; break;
} }
puts_filtered ("\n"); gdb_puts ("\n");
} }
else if (force) else if (force)
{ {
@ -1662,7 +1662,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
type == 1 type == 1
? idx : (idx * 8) | (type ? (cpl | 4) : 0)); ? idx : (idx * 8) | (type ? (cpl | 4) : 0));
if (!descr.present) if (!descr.present)
puts_filtered ("Segment not present\n"); gdb_puts ("Segment not present\n");
else else
printf_filtered ("Segment type 0x%02x is invalid in this table\n", printf_filtered ("Segment type 0x%02x is invalid in this table\n",
descr.stype); descr.stype);
@ -1700,7 +1700,7 @@ go32_sldt (const char *arg, int from_tty)
__asm__ __volatile__ ("sldt %0" : "=m" (ldtr) : /* no inputs */ ); __asm__ __volatile__ ("sldt %0" : "=m" (ldtr) : /* no inputs */ );
ldt_idx = ldtr / 8; ldt_idx = ldtr / 8;
if (ldt_idx == 0) 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. */ /* 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) else if (get_descriptor (gdtr.base, ldt_idx, &ldt_descr) != 2)
printf_filtered ("LDT is present (at %#x), but unreadable by GDB.\n", 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); printf_filtered ("Base=0x%05lx000", entry >> 12);
if ((entry & 0x100) && !is_dir) if ((entry & 0x100) && !is_dir)
puts_filtered (" Global"); gdb_puts (" Global");
if ((entry & 0x40) && !is_dir) if ((entry & 0x40) && !is_dir)
puts_filtered (" Dirty"); gdb_puts (" Dirty");
printf_filtered (" %sAcc.", (entry & 0x20) ? "" : "Not-"); printf_filtered (" %sAcc.", (entry & 0x20) ? "" : "Not-");
printf_filtered (" %sCached", (entry & 0x10) ? "" : "Not-"); printf_filtered (" %sCached", (entry & 0x10) ? "" : "Not-");
printf_filtered (" Write-%s", (entry & 8) ? "Thru" : "Back"); 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"); printf_filtered (" Read-%s", (entry & 2) ? "Write" : "Only");
if (off) if (off)
printf_filtered (" +0x%x", off); printf_filtered (" +0x%x", off);
puts_filtered ("\n"); gdb_puts ("\n");
} }
else if (force) else if (force)
printf_filtered ("Page%s not present or not supported; value=0x%lx.\n", printf_filtered ("Page%s not present or not supported; value=0x%lx.\n",
@ -1977,7 +1977,7 @@ go32_pde (const char *arg, int from_tty)
pdbr = get_cr3 (); pdbr = get_cr3 ();
if (!pdbr) if (!pdbr)
puts_filtered ("Access to Page Directories is " gdb_puts ("Access to Page Directories is "
"not supported on this system.\n"); "not supported on this system.\n");
else if (pde_idx >= 0) else if (pde_idx >= 0)
display_ptable_entry (get_pde (pde_idx), 1, 1, 0); display_ptable_entry (get_pde (pde_idx), 1, 1, 0);
@ -2002,7 +2002,7 @@ display_page_table (long n, int force)
"Page Directory entry 0x%lx:\n", n); "Page Directory entry 0x%lx:\n", n);
for (i = 0; i < 1024; i++) for (i = 0; i < 1024; i++)
display_ptable_entry (get_pte (pde, i), 0, 0, 0); display_ptable_entry (get_pte (pde, i), 0, 0, 0);
puts_filtered ("\n"); gdb_puts ("\n");
} }
else if (force) else if (force)
printf_filtered ("Page Table not present; value=0x%lx.\n", pde >> 1); 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 (); pdbr = get_cr3 ();
if (!pdbr) 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) else if (pde_idx >= 0)
display_page_table (pde_idx, 1); display_page_table (pde_idx, 1);
else else
@ -2052,7 +2052,7 @@ go32_pte_for_address (const char *arg, int from_tty)
pdbr = get_cr3 (); pdbr = get_cr3 ();
if (!pdbr) 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 else
{ {
int pde_idx = (addr >> 22) & 0x3ff; int pde_idx = (addr >> 22) & 0x3ff;

View file

@ -202,7 +202,7 @@ fputsn_filtered (const char *s, size_t size, struct ui_file *stream)
for (i = 0; i < size; ++i) for (i = 0; i < size; ++i)
{ {
if (s[i] == '\0') if (s[i] == '\0')
fputs_filtered ("\\000", stream); gdb_puts ("\\000", stream);
else else
fputc_filtered (s[i], stream); fputc_filtered (s[i], stream);
} }

View file

@ -687,7 +687,7 @@ ppscm_print_string_repr (SCM printer, enum display_hint hint,
for (i = 0; i < length; ++i) for (i = 0; i < length; ++i)
{ {
if (string.get ()[i] == '\0') if (string.get ()[i] == '\0')
fputs_filtered ("\\000", stream); gdb_puts ("\\000", stream);
else else
fputc_filtered (string.get ()[i], stream); fputc_filtered (string.get ()[i], stream);
} }
@ -826,10 +826,10 @@ ppscm_print_children (SCM printer, enum display_hint hint,
if (i == 0) if (i == 0)
{ {
if (!printed_nothing) if (!printed_nothing)
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
else if (! is_map || i % 2 == 0) 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 /* Skip printing children if max_depth has been reached. This check
is performed after print_string_repr and the "=" separator so that 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; goto done;
else if (i == 0) else if (i == 0)
/* Print initial "{" to bookend children. */ /* Print initial "{" to bookend children. */
fputs_filtered ("{", stream); gdb_puts ("{", stream);
/* In summary mode, we just want to print "= {...}" if there is /* In summary mode, we just want to print "= {...}" if there is
a value. */ a value. */
@ -857,7 +857,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
{ {
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
@ -865,7 +865,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
} }
if (is_map && i % 2 == 0) if (is_map && i % 2 == 0)
fputs_filtered ("[", stream); gdb_puts ("[", stream);
else if (is_array) else if (is_array)
{ {
/* We print the index, not whatever the child method /* 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) else if (! is_map)
{ {
fputs_filtered (name.get (), stream); gdb_puts (name.get (), stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
if (lsscm_is_lazy_string (v_scm)) 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 gdb::unique_xmalloc_ptr<char> output
= gdbscm_scm_to_c_string (v_scm); = gdbscm_scm_to_c_string (v_scm);
fputs_filtered (output.get (), stream); gdb_puts (output.get (), stream);
} }
else else
{ {
@ -920,7 +920,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
} }
if (is_map && i % 2 == 0) if (is_map && i % 2 == 0)
fputs_filtered ("] = ", stream); gdb_puts ("] = ", stream);
} }
if (i) if (i)
@ -929,17 +929,17 @@ ppscm_print_children (SCM printer, enum display_hint hint,
{ {
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
fputs_filtered ("...", stream); gdb_puts ("...", stream);
} }
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
done: done:

View file

@ -70,13 +70,13 @@ print_i387_ext (struct gdbarch *gdbarch,
fprintf_filtered (file, " %cInf", (sign ? '-' : '+')); fprintf_filtered (file, " %cInf", (sign ? '-' : '+'));
else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000) else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000)
/* Real Indefinite (QNaN). */ /* Real Indefinite (QNaN). */
fputs_filtered (" Real Indefinite (QNaN)", file); gdb_puts (" Real Indefinite (QNaN)", file);
else if (fraction[1] & 0x40000000) else if (fraction[1] & 0x40000000)
/* QNaN. */ /* QNaN. */
fputs_filtered (" QNaN", file); gdb_puts (" QNaN", file);
else else
/* SNaN. */ /* SNaN. */
fputs_filtered (" SNaN", file); gdb_puts (" SNaN", file);
} }
else if (exponent < 0x7fff && exponent > 0x0000 && integer) else if (exponent < 0x7fff && exponent > 0x0000 && integer)
/* Normal. */ /* Normal. */
@ -88,14 +88,14 @@ print_i387_ext (struct gdbarch *gdbarch,
if (integer) if (integer)
/* Pseudo-denormal. */ /* Pseudo-denormal. */
fputs_filtered (" Pseudo-denormal", file); gdb_puts (" Pseudo-denormal", file);
else if (fraction[0] || fraction[1]) else if (fraction[0] || fraction[1])
/* Denormal. */ /* Denormal. */
fputs_filtered (" Denormal", file); gdb_puts (" Denormal", file);
} }
else else
/* Unsupported. */ /* Unsupported. */
fputs_filtered (" Unsupported", file); gdb_puts (" Unsupported", file);
} }
/* Print the status word STATUS. If STATUS_P is false, then STATUS /* 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)); 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 & 0x0001) ? "IE" : " ");
fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " ");
fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " "); fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " ");
fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " "); fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " ");
fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " "); fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " ");
fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " "); fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " ");
fputs_filtered (" ", file); gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " "); fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " ");
fputs_filtered (" ", file); gdb_puts (" ", file);
fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " "); 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 & 0x0100) ? "C0" : " ");
fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " "); fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " ");
fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " "); fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " ");
fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " "); fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " ");
fputs_filtered ("\n", file); gdb_puts ("\n", file);
fprintf_filtered (file, fprintf_filtered (file,
" TOP: %d\n", ((status >> 11) & 7)); " 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)); 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 & 0x0001) ? "IM" : " ");
fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " ");
fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " "); 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 & 0x0010) ? "UM" : " ");
fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " "); 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) switch ((control >> 8) & 3)
{ {
case 0: case 0:
fputs_filtered ("Single Precision (24-bits)\n", file); gdb_puts ("Single Precision (24-bits)\n", file);
break; break;
case 1: case 1:
fputs_filtered ("Reserved\n", file); gdb_puts ("Reserved\n", file);
break; break;
case 2: case 2:
fputs_filtered ("Double Precision (53-bits)\n", file); gdb_puts ("Double Precision (53-bits)\n", file);
break; break;
case 3: case 3:
fputs_filtered ("Extended Precision (64-bits)\n", file); gdb_puts ("Extended Precision (64-bits)\n", file);
break; break;
} }
fputs_filtered (" RC: ", file); gdb_puts (" RC: ", file);
switch ((control >> 10) & 3) switch ((control >> 10) & 3)
{ {
case 0: case 0:
fputs_filtered ("Round to nearest\n", file); gdb_puts ("Round to nearest\n", file);
break; break;
case 1: case 1:
fputs_filtered ("Round down\n", file); gdb_puts ("Round down\n", file);
break; break;
case 2: case 2:
fputs_filtered ("Round up\n", file); gdb_puts ("Round up\n", file);
break; break;
case 3: case 3:
fputs_filtered ("Round toward zero\n", file); gdb_puts ("Round toward zero\n", file);
break; break;
} }
} }
@ -263,21 +263,21 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
switch (tag) switch (tag)
{ {
case 0: case 0:
fputs_filtered ("Valid ", file); gdb_puts ("Valid ", file);
break; break;
case 1: case 1:
fputs_filtered ("Zero ", file); gdb_puts ("Zero ", file);
break; break;
case 2: case 2:
fputs_filtered ("Special ", file); gdb_puts ("Special ", file);
break; break;
case 3: case 3:
fputs_filtered ("Empty ", file); gdb_puts ("Empty ", file);
break; break;
} }
} }
else else
fputs_filtered ("Unknown ", file); gdb_puts ("Unknown ", file);
regnum = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep); regnum = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep);
regval = get_frame_register_value (frame, regnum); 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 (); const gdb_byte *raw = value_contents (regval).data ();
fputs_filtered ("0x", file); gdb_puts ("0x", file);
for (i = 9; i >= 0; i--) for (i = 9; i >= 0; i--)
fprintf_filtered (file, "%02x", raw[i]); fprintf_filtered (file, "%02x", raw[i]);
@ -296,11 +296,11 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
else else
fprintf_filtered (file, "%s", _("<unavailable>")); 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_status_word (fstat_p, fstat, file);
print_i387_control_word (fctrl_p, fctrl, file); print_i387_control_word (fctrl_p, fctrl, file);
fprintf_filtered (file, "Tag Word: %s\n", fprintf_filtered (file, "Tag Word: %s\n",

View file

@ -1104,7 +1104,7 @@ jump_command (const char *arg, int from_tty)
if (from_tty) if (from_tty)
{ {
printf_filtered (_("Continuing at ")); printf_filtered (_("Continuing at "));
puts_filtered (paddress (gdbarch, addr)); gdb_puts (paddress (gdbarch, addr));
printf_filtered (".\n"); printf_filtered (".\n");
} }
@ -1955,16 +1955,16 @@ environment_info (const char *var, int from_tty)
if (val) if (val)
{ {
puts_filtered (var); gdb_puts (var);
puts_filtered (" = "); gdb_puts (" = ");
puts_filtered (val); gdb_puts (val);
puts_filtered ("\n"); gdb_puts ("\n");
} }
else else
{ {
puts_filtered ("Environment variable \""); gdb_puts ("Environment variable \"");
puts_filtered (var); gdb_puts (var);
puts_filtered ("\" not defined.\n"); gdb_puts ("\" not defined.\n");
} }
} }
else else
@ -1973,8 +1973,8 @@ environment_info (const char *var, int from_tty)
for (int idx = 0; envp[idx] != NULL; ++idx) for (int idx = 0; envp[idx] != NULL; ++idx)
{ {
puts_filtered (envp[idx]); gdb_puts (envp[idx]);
puts_filtered ("\n"); gdb_puts ("\n");
} }
} }
} }
@ -2062,9 +2062,9 @@ static const char path_var_name[] = "PATH";
static void static void
path_info (const char *args, int from_tty) path_info (const char *args, int from_tty)
{ {
puts_filtered ("Executable and object file path: "); gdb_puts ("Executable and object file path: ");
puts_filtered (current_inferior ()->environment.get (path_var_name)); gdb_puts (current_inferior ()->environment.get (path_var_name));
puts_filtered ("\n"); gdb_puts ("\n");
} }
/* Add zero or more directories to the front of the execution path. */ /* 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"); fprintf_filtered (file, "\n");
} }

View file

@ -176,7 +176,7 @@ show_disable_randomization (struct ui_file *file, int from_tty,
"virtual address space is %s.\n"), "virtual address space is %s.\n"),
value); value);
else else
fputs_filtered (_("Disabling randomization of debuggee's " gdb_puts (_("Disabling randomization of debuggee's "
"virtual address space is unsupported on\n" "virtual address space is unsupported on\n"
"this platform.\n"), file); "this platform.\n"), file);
} }

View file

@ -761,7 +761,7 @@ jit_bfd_try_read_symtab (struct jit_code_entry *code_entry,
(code_entry->symfile_addr, code_entry->symfile_size, gnutarget)); (code_entry->symfile_addr, code_entry->symfile_size, gnutarget));
if (nbfd == NULL) if (nbfd == NULL)
{ {
fputs_unfiltered (_("Error opening JITed symbol file, ignoring it.\n"), gdb_puts (_("Error opening JITed symbol file, ignoring it.\n"),
gdb_stderr); gdb_stderr);
return; return;
} }

View file

@ -580,7 +580,7 @@ info_checkpoints_command (const char *arg, int from_tty)
if (fi.num == 0) if (fi.num == 0)
printf_filtered (_(" (main process)")); printf_filtered (_(" (main process)"));
printf_filtered (_(" at ")); printf_filtered (_(" at "));
puts_filtered (paddress (gdbarch, pc)); gdb_puts (paddress (gdbarch, pc));
symtab_and_line sal = find_pc_line (pc, 0); symtab_and_line sal = find_pc_line (pc, 0);
if (sal.symtab) if (sal.symtab)

View file

@ -944,7 +944,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
gdb::unique_xmalloc_ptr<char> status gdb::unique_xmalloc_ptr<char> status
= target_fileio_read_stralloc (NULL, filename); = target_fileio_read_stralloc (NULL, filename);
if (status) if (status)
puts_filtered (status.get ()); gdb_puts (status.get ());
else else
warning (_("unable to open /proc file '%s'"), filename); warning (_("unable to open /proc file '%s'"), filename);
} }

View file

@ -778,7 +778,7 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
catch (const gdb_exception_error &except) catch (const gdb_exception_error &except)
{ {
if (warning_pre_print) if (warning_pre_print)
fputs_unfiltered (warning_pre_print, gdb_stderr); gdb_puts (warning_pre_print, gdb_stderr);
exception_fprintf (gdb_stderr, except, exception_fprintf (gdb_stderr, except,
_("libthread_db integrity checks failed: ")); _("libthread_db integrity checks failed: "));

View file

@ -145,9 +145,9 @@ void
m2_language::printchar (int c, struct type *type, m2_language::printchar (int c, struct type *type,
struct ui_file *stream) const struct ui_file *stream) const
{ {
fputs_filtered ("'", stream); gdb_puts ("'", stream);
emitchar (c, type, stream, '\''); emitchar (c, type, stream, '\'');
fputs_filtered ("'", stream); gdb_puts ("'", stream);
} }
/* See language.h. */ /* See language.h. */
@ -165,7 +165,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (length == 0) if (length == 0)
{ {
puts_filtered ("\"\""); gdb_puts ("\"\"");
return; return;
} }
@ -181,7 +181,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (need_comma) if (need_comma)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
need_comma = 0; need_comma = 0;
} }
@ -197,7 +197,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{ {
if (in_quotes) if (in_quotes)
{ {
fputs_filtered ("\", ", stream); gdb_puts ("\", ", stream);
in_quotes = 0; in_quotes = 0;
} }
printchar (string[i], elttype, stream); printchar (string[i], elttype, stream);
@ -210,7 +210,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{ {
if (!in_quotes) if (!in_quotes)
{ {
fputs_filtered ("\"", stream); gdb_puts ("\"", stream);
in_quotes = 1; in_quotes = 1;
} }
emitchar (string[i], elttype, stream, '"'); emitchar (string[i], elttype, stream, '"');
@ -220,10 +220,10 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
/* Terminate the quotes if necessary. */ /* Terminate the quotes if necessary. */
if (in_quotes) if (in_quotes)
fputs_filtered ("\"", stream); gdb_puts ("\"", stream);
if (force_ellipses || i < length) if (force_ellipses || i < length)
fputs_filtered ("...", stream); gdb_puts ("...", stream);
} }
/* See language.h. */ /* See language.h. */
@ -237,7 +237,7 @@ m2_language::emitchar (int ch, struct type *chtype,
if (PRINT_LITERAL_FORM (ch)) if (PRINT_LITERAL_FORM (ch))
{ {
if (ch == '\\' || ch == quoter) if (ch == '\\' || ch == quoter)
fputs_filtered ("\\", stream); gdb_puts ("\\", stream);
fprintf_filtered (stream, "%c", ch); fprintf_filtered (stream, "%c", ch);
} }
else else
@ -245,25 +245,25 @@ m2_language::emitchar (int ch, struct type *chtype,
switch (ch) switch (ch)
{ {
case '\n': case '\n':
fputs_filtered ("\\n", stream); gdb_puts ("\\n", stream);
break; break;
case '\b': case '\b':
fputs_filtered ("\\b", stream); gdb_puts ("\\b", stream);
break; break;
case '\t': case '\t':
fputs_filtered ("\\t", stream); gdb_puts ("\\t", stream);
break; break;
case '\f': case '\f':
fputs_filtered ("\\f", stream); gdb_puts ("\\f", stream);
break; break;
case '\r': case '\r':
fputs_filtered ("\\r", stream); gdb_puts ("\\r", stream);
break; break;
case '\033': case '\033':
fputs_filtered ("\\e", stream); gdb_puts ("\\e", stream);
break; break;
case '\007': case '\007':
fputs_filtered ("\\a", stream); gdb_puts ("\\a", stream);
break; break;
default: default:
fprintf_filtered (stream, "\\%.3o", (unsigned int) ch); fprintf_filtered (stream, "\\%.3o", (unsigned int) ch);

View file

@ -179,7 +179,7 @@ void
m2_type_name (struct type *type, struct ui_file *stream) m2_type_name (struct type *type, struct ui_file *stream)
{ {
if (type->name () != NULL) if (type->name () != NULL)
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
} }
/* m2_range - displays a Modula-2 subrange type. */ /* 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) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
} }
@ -235,7 +235,7 @@ static void m2_array (struct type *type, struct ui_file *stream,
m2_print_bounds (type->index_type (), stream, show, -1, 1); m2_print_bounds (type->index_type (), stream, show, -1, 1);
} }
else else
fputs_filtered (pulongest ((TYPE_LENGTH (type) gdb_puts (pulongest ((TYPE_LENGTH (type)
/ TYPE_LENGTH (TYPE_TARGET_TYPE (type)))), / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))),
stream); stream);
} }
@ -291,7 +291,7 @@ m2_procedure (struct type *type, struct ui_file *stream,
{ {
if (i > 0) if (i > 0)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (4); stream->wrap_here (4);
} }
m2_print_type (type->field (i).type (), "", stream, -1, 0, flags); 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) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
if (show == 0) if (show == 0)
return 1; return 1;
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
if (get_long_set_bounds (type, &low, &high)) 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) if (show > 0)
{ {
fputs_filtered ("ARRAY OF ", stream); gdb_puts ("ARRAY OF ", stream);
m2_print_type (TYPE_TARGET_TYPE (type->field (0).type ()), m2_print_type (TYPE_TARGET_TYPE (type->field (0).type ()),
"", stream, 0, level, flags); "", stream, 0, level, flags);
} }
@ -534,7 +534,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
{ {
if (!startswith (type->name (), "$$")) if (!startswith (type->name (), "$$"))
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
if (show > 0) if (show > 0)
fprintf_filtered (stream, " = "); 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); print_spaces_filtered (level + 4, stream);
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
fputs_filtered (" : ", stream); gdb_puts (" : ", stream);
m2_print_type (type->field (i).type (), m2_print_type (type->field (i).type (),
"", "",
stream, 0, level + 4, flags); stream, 0, level + 4, flags);

View file

@ -200,7 +200,7 @@ print_unpacked_pointer (struct type *type,
if (options->addressprint && options->format != 's') if (options->addressprint && options->format != 's')
{ {
fputs_filtered (paddress (gdbarch, address), stream); gdb_puts (paddress (gdbarch, address), stream);
want_space = 1; want_space = 1;
} }
@ -213,7 +213,7 @@ print_unpacked_pointer (struct type *type,
&& addr != 0) && addr != 0)
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1, return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
stream, options); stream, options);
} }
@ -233,7 +233,7 @@ print_variable_at_address (struct type *type,
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type)); struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
fprintf_filtered (stream, "["); fprintf_filtered (stream, "[");
fputs_filtered (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
fprintf_filtered (stream, "] : "); fprintf_filtered (stream, "] : ");
if (elttype->code () != TYPE_CODE_UNDEF) 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); common_val_print (deref_val, stream, recurse, options, current_language);
} }
else 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 i;
int need_comma = 0; int need_comma = 0;
fputs_filtered ("{", stream); gdb_puts ("{", stream);
i = get_discrete_bounds (range, &low_bound, &high_bound) ? 0 : -1; i = get_discrete_bounds (range, &low_bound, &high_bound) ? 0 : -1;
maybe_bad_bstring: maybe_bad_bstring:
@ -420,7 +420,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
if (element) if (element)
{ {
if (need_comma) if (need_comma)
fputs_filtered (", ", stream); gdb_puts (", ", stream);
print_type_scalar (range, i, stream); print_type_scalar (range, i, stream);
need_comma = 1; need_comma = 1;
@ -429,7 +429,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
{ {
int j = i; int j = i;
fputs_filtered ("..", stream); gdb_puts ("..", stream);
while (i + 1 <= high_bound while (i + 1 <= high_bound
&& value_bit_index (type, valaddr, ++i)) && value_bit_index (type, valaddr, ++i))
j = i; j = i;
@ -438,7 +438,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
} }
} }
done: done:
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
break; break;

View file

@ -41,7 +41,7 @@ static struct cmd_list_element *macrolist;
static void static void
macro_inform_no_debuginfo (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 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); gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
puts_filtered ("expands to: "); gdb_puts ("expands to: ");
puts_filtered (expanded.get ()); gdb_puts (expanded.get ());
puts_filtered ("\n"); gdb_puts ("\n");
} }
else else
macro_inform_no_debuginfo (); 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); gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
puts_filtered ("expands to: "); gdb_puts ("expands to: ");
puts_filtered (expanded.get ()); gdb_puts (expanded.get ());
puts_filtered ("\n"); gdb_puts ("\n");
} }
else else
macro_inform_no_debuginfo (); macro_inform_no_debuginfo ();
@ -117,7 +117,7 @@ show_pp_source_pos (struct ui_file *stream,
while (file->included_by) while (file->included_by)
{ {
fullname = macro_source_fullname (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); fputs_styled (fullname.c_str (), file_name_style.style (), stream);
fprintf_filtered (stream, ":%d\n", file->included_at_line); fprintf_filtered (stream, ":%d\n", file->included_at_line);
file = file->included_by; file = file->included_by;
@ -149,14 +149,14 @@ print_macro_definition (const char *name,
{ {
int i; int i;
puts_filtered ("("); gdb_puts ("(");
for (i = 0; i < d->argc; i++) for (i = 0; i < d->argc; i++)
{ {
puts_filtered (d->argv[i]); gdb_puts (d->argv[i]);
if (i + 1 < d->argc) if (i + 1 < d->argc)
puts_filtered (", "); gdb_puts (", ");
} }
puts_filtered (")"); gdb_puts (")");
} }
if (line != 0) if (line != 0)

View file

@ -1394,12 +1394,12 @@ print_gdb_help (struct ui_file *stream)
/* Note: The options in the list below are only approximately sorted /* Note: The options in the list below are only approximately sorted
in the alphabetical order, so as to group closely related options in the alphabetical order, so as to group closely related options
together. */ together. */
fputs_unfiltered (_("\ gdb_puts (_("\
This is the GNU debugger. Usage:\n\n\ This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\ gdb [options] [executable-file [core-file or process-id]]\n\
gdb [options] --args executable-file [inferior-arguments ...]\n\n\ gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream); "), stream);
fputs_unfiltered (_("\ gdb_puts (_("\
Selection of debuggee and its files:\n\n\ Selection of debuggee and its files:\n\n\
--args Arguments after executable-file are passed to inferior.\n\ --args Arguments after executable-file are passed to inferior.\n\
--core=COREFILE Analyze the core dump COREFILE.\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\ --readnever Do not read symbol files.\n\
--write Set writing into executable and core files.\n\n\ --write Set writing into executable and core files.\n\n\
"), stream); "), stream);
fputs_unfiltered (_("\ gdb_puts (_("\
Initial commands and command files:\n\n\ Initial commands and command files:\n\n\
--command=FILE, -x Execute GDB commands from FILE.\n\ --command=FILE, -x Execute GDB commands from FILE.\n\
--init-command=FILE, -ix\n\ --init-command=FILE, -ix\n\
@ -1426,7 +1426,7 @@ Initial commands and command files:\n\n\
--nh Do not read ~/.gdbinit.\n\ --nh Do not read ~/.gdbinit.\n\
--nx Do not read any .gdbinit files in any directory.\n\n\ --nx Do not read any .gdbinit files in any directory.\n\n\
"), stream); "), stream);
fputs_unfiltered (_("\ gdb_puts (_("\
Output and user interface control:\n\n\ Output and user interface control:\n\n\
--fullname Output information used by emacs-GDB interface.\n\ --fullname Output information used by emacs-GDB interface.\n\
--interpreter=INTERP\n\ --interpreter=INTERP\n\
@ -1436,16 +1436,16 @@ Output and user interface control:\n\n\
--nw Do not use the GUI interface.\n\ --nw Do not use the GUI interface.\n\
"), stream); "), stream);
#if defined(TUI) #if defined(TUI)
fputs_unfiltered (_("\ gdb_puts (_("\
--tui Use a terminal user interface.\n\ --tui Use a terminal user interface.\n\
"), stream); "), stream);
#endif #endif
fputs_unfiltered (_("\ gdb_puts (_("\
--dbx DBX compatibility mode.\n\ --dbx DBX compatibility mode.\n\
-q, --quiet, --silent\n\ -q, --quiet, --silent\n\
Do not print version number on startup.\n\n\ Do not print version number on startup.\n\n\
"), stream); "), stream);
fputs_unfiltered (_("\ gdb_puts (_("\
Operating modes:\n\n\ Operating modes:\n\n\
--batch Exit after processing options.\n\ --batch Exit after processing options.\n\
--batch-silent Like --batch, but suppress all gdb stdout output.\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\ --data-directory=DIR, -D\n\
Set GDB's data-directory to DIR.\n\ Set GDB's data-directory to DIR.\n\
"), stream); "), stream);
fputs_unfiltered (_("\n\ gdb_puts (_("\n\
At startup, GDB reads the following early init files and executes their\n\ At startup, GDB reads the following early init files and executes their\n\
commands:\n\ commands:\n\
"), stream); "), stream);
@ -1473,7 +1473,7 @@ commands:\n\
if (home_gdbearlyinit.empty ()) if (home_gdbearlyinit.empty ())
fprintf_unfiltered (stream, _("\ fprintf_unfiltered (stream, _("\
None found.\n")); None found.\n"));
fputs_unfiltered (_("\n\ gdb_puts (_("\n\
At startup, GDB reads the following init files and executes their commands:\n\ At startup, GDB reads the following init files and executes their commands:\n\
"), stream); "), stream);
if (!system_gdbinit.empty ()) if (!system_gdbinit.empty ())
@ -1501,7 +1501,7 @@ At startup, GDB reads the following init files and executes their commands:\n\
&& local_gdbinit.empty ()) && local_gdbinit.empty ())
fprintf_unfiltered (stream, _("\ fprintf_unfiltered (stream, _("\
None found.\n")); None found.\n"));
fputs_unfiltered (_("\n\ gdb_puts (_("\n\
For more information, type \"help\" from within GDB, or consult the\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\ GDB manual (available as on-line info or a printed manual).\n\
"), stream); "), stream);

View file

@ -279,7 +279,7 @@ static void
maintenance_show_test_options_completion_result (const char *args, maintenance_show_test_options_completion_result (const char *args,
int from_tty) 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 /* Save the completion result in the global variables read by the

View file

@ -363,7 +363,7 @@ static void
maint_print_all_sections (const char *header, bfd *abfd, objfile *objfile, maint_print_all_sections (const char *header, bfd *abfd, objfile *objfile,
const char *arg) const char *arg)
{ {
puts_filtered (header); gdb_puts (header);
gdb_stdout->wrap_here (8); gdb_stdout->wrap_here (8);
printf_filtered ("`%s', ", bfd_get_filename (abfd)); printf_filtered ("`%s', ", bfd_get_filename (abfd));
gdb_stdout->wrap_here (8); gdb_stdout->wrap_here (8);

View file

@ -269,16 +269,16 @@ def write_debugmethod(f, content, name, return_type, argtypes):
) )
for i in range(len(argtypes)): for i in range(len(argtypes)):
if i > 0: if i > 0:
print(' fputs_unfiltered (", ", gdb_stdlog);', file=f) print(' gdb_puts (", ", gdb_stdlog);', file=f)
printer = munge_type(argtypes[i]) printer = munge_type(argtypes[i])
print(" " + printer + " (" + names[i] + ");", file=f) print(" " + printer + " (" + names[i] + ");", file=f)
if return_type != "void": if return_type != "void":
print(' fputs_unfiltered (") = ", gdb_stdlog);', file=f) print(' gdb_puts (") = ", gdb_stdlog);', file=f)
printer = munge_type(return_type) printer = munge_type(return_type)
print(" " + printer + " (result);", file=f) print(" " + printer + " (result);", file=f)
print(' fputs_unfiltered ("\\n", gdb_stdlog);', file=f) print(' gdb_puts ("\\n", gdb_stdlog);', file=f)
else: else:
print(' fputs_unfiltered (")\\n", gdb_stdlog);', file=f) print(' gdb_puts (")\\n", gdb_stdlog);', file=f)
if return_type != "void": if return_type != "void":
print(" return result;", file=f) print(" return result;", file=f)

View file

@ -76,7 +76,7 @@ mi_console_file::flush ()
size_t length_buf = str.size (); size_t length_buf = str.size ();
const char *buf = str.data (); const char *buf = str.data ();
fputs_unfiltered (m_prefix, m_raw); gdb_puts (m_prefix, m_raw);
if (m_quote) if (m_quote)
{ {
fputc_unfiltered (m_quote, m_raw); fputc_unfiltered (m_quote, m_raw);

View file

@ -98,7 +98,7 @@ display_mi_prompt (struct mi_interp *mi)
{ {
struct ui *ui = current_ui; struct ui *ui = current_ui;
fputs_unfiltered ("(gdb) \n", mi->raw_stdout); gdb_puts ("(gdb) \n", mi->raw_stdout);
gdb_flush (mi->raw_stdout); gdb_flush (mi->raw_stdout);
ui->prompt_state = PROMPTED; 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); 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_put (mi_uiout, mi->raw_stdout);
mi_out_rewind (mi_uiout); mi_out_rewind (mi_uiout);
mi_print_timing_maybe (mi->raw_stdout); mi_print_timing_maybe (mi->raw_stdout);
fputs_unfiltered ("\n", mi->raw_stdout); gdb_puts ("\n", mi->raw_stdout);
gdb_flush (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 even if it cannot actually accept any input. This will be
surely removed for MI3, and may be removed even earlier. */ surely removed for MI3, and may be removed even earlier. */
if (current_ui->prompt_state == PROMPT_BLOCKED) 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); gdb_flush (mi->raw_stdout);
} }

View file

@ -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. */ /* We have to print everything right here because we never return. */
if (current_token) if (current_token)
fputs_unfiltered (current_token, mi->raw_stdout); gdb_puts (current_token, mi->raw_stdout);
fputs_unfiltered ("^exit\n", mi->raw_stdout); gdb_puts ("^exit\n", mi->raw_stdout);
mi_out_put (current_uiout, mi->raw_stdout); mi_out_put (current_uiout, mi->raw_stdout);
gdb_flush (mi->raw_stdout); gdb_flush (mi->raw_stdout);
/* FIXME: The function called is not yet a formal libgdb function. */ /* 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. */ uiout will most likely crash in the mi_out_* routines. */
if (!running_result_record_printed) 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 /* There's no particularly good reason why target-connect results
in not ^done. Should kill ^connected for MI3. */ in not ^done. Should kill ^connected for MI3. */
fputs_unfiltered (strcmp (context->command, "target-select") == 0 gdb_puts (strcmp (context->command, "target-select") == 0
? "^connected" : "^done", mi->raw_stdout); ? "^connected" : "^done", mi->raw_stdout);
mi_out_put (uiout, mi->raw_stdout); mi_out_put (uiout, mi->raw_stdout);
mi_out_rewind (uiout); mi_out_rewind (uiout);
mi_print_timing_maybe (mi->raw_stdout); mi_print_timing_maybe (mi->raw_stdout);
fputs_unfiltered ("\n", mi->raw_stdout); gdb_puts ("\n", mi->raw_stdout);
} }
else else
/* The command does not want anything to be printed. In that /* 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) if (!running_result_record_printed)
{ {
fputs_unfiltered (context->token, mi->raw_stdout); gdb_puts (context->token, mi->raw_stdout);
fputs_unfiltered ("^done", mi->raw_stdout); gdb_puts ("^done", mi->raw_stdout);
mi_out_put (uiout, mi->raw_stdout); mi_out_put (uiout, mi->raw_stdout);
mi_out_rewind (uiout); mi_out_rewind (uiout);
mi_print_timing_maybe (mi->raw_stdout); mi_print_timing_maybe (mi->raw_stdout);
fputs_unfiltered ("\n", mi->raw_stdout); gdb_puts ("\n", mi->raw_stdout);
} }
else else
mi_out_rewind (uiout); 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 (); struct mi_interp *mi = (struct mi_interp *) current_interpreter ();
fputs_unfiltered (token, mi->raw_stdout); gdb_puts (token, mi->raw_stdout);
fputs_unfiltered ("^error,msg=\"", mi->raw_stdout); gdb_puts ("^error,msg=\"", mi->raw_stdout);
if (exception.message == NULL) if (exception.message == NULL)
fputs_unfiltered ("unknown error", mi->raw_stdout); gdb_puts ("unknown error", mi->raw_stdout);
else else
mi->raw_stdout->putstr (exception.what (), '"'); mi->raw_stdout->putstr (exception.what (), '"');
fputs_unfiltered ("\"", mi->raw_stdout); gdb_puts ("\"", mi->raw_stdout);
switch (exception.error) switch (exception.error)
{ {
case UNDEFINED_COMMAND_ERROR: case UNDEFINED_COMMAND_ERROR:
fputs_unfiltered (",code=\"undefined-command\"", mi->raw_stdout); gdb_puts (",code=\"undefined-command\"", mi->raw_stdout);
break; break;
} }
fputs_unfiltered ("\n", mi->raw_stdout); gdb_puts ("\n", mi->raw_stdout);
} }
void void
@ -2187,8 +2187,8 @@ mi_load_progress (const char *section_name,
previous_sect_name = xstrdup (section_name); previous_sect_name = xstrdup (section_name);
if (current_token) if (current_token)
fputs_unfiltered (current_token, mi->raw_stdout); gdb_puts (current_token, mi->raw_stdout);
fputs_unfiltered ("+download", mi->raw_stdout); gdb_puts ("+download", mi->raw_stdout);
{ {
ui_out_emit_tuple tuple_emitter (uiout.get (), NULL); ui_out_emit_tuple tuple_emitter (uiout.get (), NULL);
uiout->field_string ("section", section_name); uiout->field_string ("section", section_name);
@ -2196,7 +2196,7 @@ mi_load_progress (const char *section_name,
uiout->field_signed ("total-size", grand_total); uiout->field_signed ("total-size", grand_total);
} }
mi_out_put (uiout.get (), mi->raw_stdout); 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); gdb_flush (mi->raw_stdout);
} }
@ -2205,8 +2205,8 @@ mi_load_progress (const char *section_name,
{ {
last_update = time_now; last_update = time_now;
if (current_token) if (current_token)
fputs_unfiltered (current_token, mi->raw_stdout); gdb_puts (current_token, mi->raw_stdout);
fputs_unfiltered ("+download", mi->raw_stdout); gdb_puts ("+download", mi->raw_stdout);
{ {
ui_out_emit_tuple tuple_emitter (uiout.get (), NULL); ui_out_emit_tuple tuple_emitter (uiout.get (), NULL);
uiout->field_string ("section", section_name); uiout->field_string ("section", section_name);
@ -2216,7 +2216,7 @@ mi_load_progress (const char *section_name,
uiout->field_signed ("total-size", grand_total); uiout->field_signed ("total-size", grand_total);
} }
mi_out_put (uiout.get (), mi->raw_stdout); 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); gdb_flush (mi->raw_stdout);
} }
} }

View file

@ -150,9 +150,9 @@ mi_ui_out::do_field_fmt (int fldno, int width, ui_align align,
if (fldname) if (fldname)
fprintf_unfiltered (stream, "%s=\"", fldname); fprintf_unfiltered (stream, "%s=\"", fldname);
else else
fputs_unfiltered ("\"", stream); gdb_puts ("\"", stream);
gdb_vprintf (stream, format, args); gdb_vprintf (stream, format, args);
fputs_unfiltered ("\"", stream); gdb_puts ("\"", stream);
} }
void void

View file

@ -508,7 +508,7 @@ mips_show_dr (const char *func, CORE_ADDR addr,
{ {
int i; int i;
fputs_unfiltered (func, gdb_stdlog); gdb_puts (func, gdb_stdlog);
if (addr || len) if (addr || len)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
" (addr=%s, len=%d, type=%s)", " (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_access ? "data-read/write"
: (type == hw_execute ? "instruction-execute" : (type == hw_execute ? "instruction-execute"
: "??unknown??")))); : "??unknown??"))));
fputs_unfiltered (":\n", gdb_stdlog); gdb_puts (":\n", gdb_stdlog);
for (i = 0; i < MAX_DEBUG_REGISTER; i++) for (i = 0; i < MAX_DEBUG_REGISTER; i++)
fprintf_unfiltered (gdb_stdlog, "\tDR%d: lo=%s, hi=%s\n", i, fprintf_unfiltered (gdb_stdlog, "\tDR%d: lo=%s, hi=%s\n", i,

View file

@ -6391,7 +6391,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
val = get_frame_register_value (frame, regnum); 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 problem with printing numeric register names (r26, etc.) is that
the user can't use them on input. Probably the best solution is to 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) print_fpu_flags (struct ui_file *file, int flags)
{ {
if (flags & (1 << 0)) if (flags & (1 << 0))
fputs_filtered (" inexact", file); gdb_puts (" inexact", file);
if (flags & (1 << 1)) if (flags & (1 << 1))
fputs_filtered (" uflow", file); gdb_puts (" uflow", file);
if (flags & (1 << 2)) if (flags & (1 << 2))
fputs_filtered (" oflow", file); gdb_puts (" oflow", file);
if (flags & (1 << 3)) if (flags & (1 << 3))
fputs_filtered (" div0", file); gdb_puts (" div0", file);
if (flags & (1 << 4)) if (flags & (1 << 4))
fputs_filtered (" inval", file); gdb_puts (" inval", file);
if (flags & (1 << 5)) if (flags & (1 << 5))
fputs_filtered (" unimp", file); gdb_puts (" unimp", file);
fputc_filtered ('\n', file); fputc_filtered ('\n', file);
} }
@ -6452,39 +6452,39 @@ mips_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
fprintf_filtered (file, "reg size: %d bits\n", fprintf_filtered (file, "reg size: %d bits\n",
register_size (gdbarch, mips_regnum (gdbarch)->fp0) * 8); register_size (gdbarch, mips_regnum (gdbarch)->fp0) * 8);
fputs_filtered ("cond :", file); gdb_puts ("cond :", file);
if (fcs & (1 << 23)) if (fcs & (1 << 23))
fputs_filtered (" 0", file); gdb_puts (" 0", file);
for (i = 1; i <= 7; i++) for (i = 1; i <= 7; i++)
if (fcs & (1 << (24 + i))) if (fcs & (1 << (24 + i)))
fprintf_filtered (file, " %d", i); fprintf_filtered (file, " %d", i);
fputc_filtered ('\n', file); fputc_filtered ('\n', file);
fputs_filtered ("cause :", file); gdb_puts ("cause :", file);
print_fpu_flags (file, (fcs >> 12) & 0x3f); print_fpu_flags (file, (fcs >> 12) & 0x3f);
fputs ("mask :", stdout); fputs ("mask :", stdout);
print_fpu_flags (file, (fcs >> 7) & 0x1f); print_fpu_flags (file, (fcs >> 7) & 0x1f);
fputs ("flags :", stdout); fputs ("flags :", stdout);
print_fpu_flags (file, (fcs >> 2) & 0x1f); print_fpu_flags (file, (fcs >> 2) & 0x1f);
fputs_filtered ("rounding: ", file); gdb_puts ("rounding: ", file);
switch (fcs & 3) switch (fcs & 3)
{ {
case 0: fputs_filtered ("nearest\n", file); break; case 0: gdb_puts ("nearest\n", file); break;
case 1: fputs_filtered ("zero\n", file); break; case 1: gdb_puts ("zero\n", file); break;
case 2: fputs_filtered ("+inf\n", file); break; case 2: gdb_puts ("+inf\n", file); break;
case 3: fputs_filtered ("-inf\n", file); break; case 3: gdb_puts ("-inf\n", file); break;
} }
fputs_filtered ("flush :", file); gdb_puts ("flush :", file);
if (fcs & (1 << 21)) if (fcs & (1 << 21))
fputs_filtered (" nearest", file); gdb_puts (" nearest", file);
if (fcs & (1 << 22)) if (fcs & (1 << 22))
fputs_filtered (" override", file); gdb_puts (" override", file);
if (fcs & (1 << 24)) if (fcs & (1 << 24))
fputs_filtered (" zero", file); gdb_puts (" zero", file);
if ((fcs & (0xb << 21)) == 0) if ((fcs & (0xb << 21)) == 0)
fputs_filtered (" no", file); gdb_puts (" no", file);
fputc_filtered ('\n', file); fputc_filtered ('\n', file);
fprintf_filtered (file, "nan2008 : %s\n", fcs & (1 << 18) ? "yes" : "no"); fprintf_filtered (file, "nan2008 : %s\n", fcs & (1 << 18) ? "yes" : "no");

View file

@ -152,11 +152,11 @@ pascal_language::print_one_char (int c, struct ui_file *stream,
if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c)))) if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
{ {
if (!(*in_quotes)) if (!(*in_quotes))
fputs_filtered ("'", stream); gdb_puts ("'", stream);
*in_quotes = 1; *in_quotes = 1;
if (c == '\'') if (c == '\'')
{ {
fputs_filtered ("''", stream); gdb_puts ("''", stream);
} }
else else
fprintf_filtered (stream, "%c", c); fprintf_filtered (stream, "%c", c);
@ -164,7 +164,7 @@ pascal_language::print_one_char (int c, struct ui_file *stream,
else else
{ {
if (*in_quotes) if (*in_quotes)
fputs_filtered ("'", stream); gdb_puts ("'", stream);
*in_quotes = 0; *in_quotes = 0;
fprintf_filtered (stream, "#%d", (unsigned int) c); fprintf_filtered (stream, "#%d", (unsigned int) c);
} }
@ -180,7 +180,7 @@ pascal_language::printchar (int c, struct type *type,
print_one_char (c, stream, &in_quotes); print_one_char (c, stream, &in_quotes);
if (in_quotes) if (in_quotes)
fputs_filtered ("'", stream); gdb_puts ("'", stream);
} }
@ -249,7 +249,7 @@ pascal_language::printstr (struct ui_file *stream, struct type *elttype,
if (length == 0) if (length == 0)
{ {
fputs_filtered ("''", stream); gdb_puts ("''", stream);
return; return;
} }
@ -266,7 +266,7 @@ pascal_language::printstr (struct ui_file *stream, struct type *elttype,
if (need_comma) if (need_comma)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
need_comma = 0; need_comma = 0;
} }
@ -287,7 +287,7 @@ pascal_language::printstr (struct ui_file *stream, struct type *elttype,
{ {
if (in_quotes) if (in_quotes)
{ {
fputs_filtered ("', ", stream); gdb_puts ("', ", stream);
in_quotes = 0; in_quotes = 0;
} }
printchar (current_char, elttype, stream); printchar (current_char, elttype, stream);
@ -302,7 +302,7 @@ pascal_language::printstr (struct ui_file *stream, struct type *elttype,
{ {
if ((!in_quotes) && (PRINT_LITERAL_FORM (current_char))) if ((!in_quotes) && (PRINT_LITERAL_FORM (current_char)))
{ {
fputs_filtered ("'", stream); gdb_puts ("'", stream);
in_quotes = 1; in_quotes = 1;
} }
print_one_char (current_char, stream, &in_quotes); print_one_char (current_char, stream, &in_quotes);
@ -312,10 +312,10 @@ pascal_language::printstr (struct ui_file *stream, struct type *elttype,
/* Terminate the quotes if necessary. */ /* Terminate the quotes if necessary. */
if (in_quotes) if (in_quotes)
fputs_filtered ("'", stream); gdb_puts ("'", stream);
if (force_ellipses || i < length) if (force_ellipses || i < length)
fputs_filtered ("...", stream); gdb_puts ("...", stream);
} }
/* Single instance of the Pascal language class. */ /* Single instance of the Pascal language class. */

View file

@ -116,7 +116,7 @@ public:
print_one_char (ch, stream, &in_quotes); print_one_char (ch, stream, &in_quotes);
if (in_quotes) if (in_quotes)
fputs_filtered ("'", stream); gdb_puts ("'", stream);
} }
/* See language.h. */ /* See language.h. */

View file

@ -55,13 +55,13 @@ pascal_language::print_type (struct type *type, const char *varstring,
type_print_varspec_prefix (type, stream, show, 0, flags); type_print_varspec_prefix (type, stream, show, 0, flags);
} }
/* first the name */ /* first the name */
fputs_filtered (varstring, stream); gdb_puts (varstring, stream);
if ((varstring != NULL && *varstring != '\0') if ((varstring != NULL && *varstring != '\0')
&& !(code == TYPE_CODE_FUNC && !(code == TYPE_CODE_FUNC
|| code == TYPE_CODE_METHOD)) || code == TYPE_CODE_METHOD))
{ {
fputs_filtered (" : ", stream); gdb_puts (" : ", stream);
} }
if (!(code == TYPE_CODE_FUNC if (!(code == TYPE_CODE_FUNC
@ -104,7 +104,7 @@ pascal_language::type_print_derivation_info (struct ui_file *stream,
for (i = 0; i < TYPE_N_BASECLASSES (type); i++) for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{ {
fputs_filtered (i == 0 ? ": " : ", ", stream); gdb_puts (i == 0 ? ": " : ", ", stream);
fprintf_filtered (stream, "%s%s ", fprintf_filtered (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i) ? "public" : "private", BASETYPE_VIA_PUBLIC (type, i) ? "public" : "private",
BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : ""); BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
@ -113,7 +113,7 @@ pascal_language::type_print_derivation_info (struct ui_file *stream,
} }
if (i > 0) if (i > 0)
{ {
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
} }
@ -132,11 +132,11 @@ pascal_language::type_print_method_args (const char *physname,
physname += 6; physname += 6;
} }
fputs_filtered (methodname, stream); gdb_puts (methodname, stream);
if (physname && (*physname != 0)) if (physname && (*physname != 0))
{ {
fputs_filtered (" (", stream); gdb_puts (" (", stream);
/* We must demangle this. */ /* We must demangle this. */
while (isdigit (physname[0])) while (isdigit (physname[0]))
{ {
@ -157,10 +157,10 @@ pascal_language::type_print_method_args (const char *physname,
physname += i; physname += i;
if (physname[0] != 0) if (physname[0] != 0)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
} }
} }
fputs_filtered (")", stream); gdb_puts (")", stream);
} }
} }
@ -286,7 +286,7 @@ pascal_language::print_func_args (struct type *type, struct ui_file *stream,
{ {
if (i > 0) if (i > 0)
{ {
fputs_filtered (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (4); stream->wrap_here (4);
} }
/* Can we find if it is a var parameter ?? /* Can we find if it is a var parameter ??
@ -430,7 +430,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
if ((type->code () == TYPE_CODE_PTR) if ((type->code () == TYPE_CODE_PTR)
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)) && (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID))
{ {
fputs_filtered (type->name () ? type->name () : "pointer", gdb_puts (type->name () ? type->name () : "pointer",
stream); stream);
return; return;
} }
@ -440,7 +440,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
if (show <= 0 if (show <= 0
&& type->name () != NULL) && type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
return; return;
} }
@ -465,8 +465,8 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
if (type->name () != NULL) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
if (HAVE_CPLUS_STRUCT (type)) if (HAVE_CPLUS_STRUCT (type))
{ {
@ -481,8 +481,8 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
if (type->name () != NULL) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
fprintf_filtered (stream, "case <?> of "); fprintf_filtered (stream, "case <?> of ");
@ -668,7 +668,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0 if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0
&& TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID) && TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID)
{ {
fputs_filtered (" : ", stream); gdb_puts (" : ", stream);
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, -1); "", stream, -1);
} }
@ -685,9 +685,9 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
if (type->name () != NULL) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
if (show > 0) if (show > 0)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
/* enum is just defined by /* enum is just defined by
type enume_name = (enum_member1,enum_member2,...) */ type enume_name = (enum_member1,enum_member2,...) */
@ -710,7 +710,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
if (i) if (i)
fprintf_filtered (stream, ", "); fprintf_filtered (stream, ", ");
stream->wrap_here (4); stream->wrap_here (4);
fputs_filtered (type->field (i).name (), stream); gdb_puts (type->field (i).name (), stream);
if (lastval != type->field (i).loc_enumval ()) if (lastval != type->field (i).loc_enumval ())
{ {
fprintf_filtered (stream, fprintf_filtered (stream,
@ -742,19 +742,19 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
struct type *target = TYPE_TARGET_TYPE (type); struct type *target = TYPE_TARGET_TYPE (type);
print_type_scalar (target, type->bounds ()->low.const_val (), stream); print_type_scalar (target, type->bounds ()->low.const_val (), stream);
fputs_filtered ("..", stream); gdb_puts ("..", stream);
print_type_scalar (target, type->bounds ()->high.const_val (), stream); print_type_scalar (target, type->bounds ()->high.const_val (), stream);
} }
break; break;
case TYPE_CODE_SET: case TYPE_CODE_SET:
fputs_filtered ("set of ", stream); gdb_puts ("set of ", stream);
print_type (type->index_type (), "", stream, print_type (type->index_type (), "", stream,
show - 1, level, flags); show - 1, level, flags);
break; break;
case TYPE_CODE_STRING: case TYPE_CODE_STRING:
fputs_filtered ("String", stream); gdb_puts ("String", stream);
break; break;
default: default:
@ -764,7 +764,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
is no type name, then complain. */ is no type name, then complain. */
if (type->name () != NULL) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
} }
else else
{ {

View file

@ -176,7 +176,7 @@ pascal_language::value_print_inner (struct value *val,
if (options->addressprint && options->format != 's') if (options->addressprint && options->format != 's')
{ {
fputs_filtered (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
want_space = 1; want_space = 1;
} }
@ -191,7 +191,7 @@ pascal_language::value_print_inner (struct value *val,
&& addr != 0) && addr != 0)
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
/* No wide string yet. */ /* No wide string yet. */
i = val_print_string (elttype, NULL, addr, -1, stream, options); i = val_print_string (elttype, NULL, addr, -1, stream, options);
} }
@ -208,7 +208,7 @@ pascal_language::value_print_inner (struct value *val,
gdb_byte *buffer; gdb_byte *buffer;
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
buffer = (gdb_byte *) xmalloc (length_size); buffer = (gdb_byte *) xmalloc (length_size);
read_memory (addr + length_pos, buffer, length_size); read_memory (addr + length_pos, buffer, length_size);
string_length = extract_unsigned_integer (buffer, length_size, string_length = extract_unsigned_integer (buffer, length_size,
@ -231,10 +231,10 @@ pascal_language::value_print_inner (struct value *val,
&& (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol))) && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
{ {
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
fputs_filtered ("<", stream); gdb_puts ("<", stream);
fputs_filtered (msymbol.minsym->print_name (), stream); gdb_puts (msymbol.minsym->print_name (), stream);
fputs_filtered (">", stream); gdb_puts (">", stream);
want_space = 1; want_space = 1;
} }
if (vt_address && options->vtblprint) if (vt_address && options->vtblprint)
@ -244,7 +244,7 @@ pascal_language::value_print_inner (struct value *val,
struct type *wtype; struct type *wtype;
if (want_space) if (want_space)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
if (msymbol.minsym != NULL) if (msymbol.minsym != NULL)
{ {
@ -341,7 +341,7 @@ pascal_language::value_print_inner (struct value *val,
LONGEST low_bound, high_bound; LONGEST low_bound, high_bound;
int need_comma = 0; int need_comma = 0;
fputs_filtered ("[", stream); gdb_puts ("[", stream);
int bound_info = (get_discrete_bounds (range, &low_bound, &high_bound) int bound_info = (get_discrete_bounds (range, &low_bound, &high_bound)
? 0 : -1); ? 0 : -1);
@ -372,7 +372,7 @@ pascal_language::value_print_inner (struct value *val,
if (element) if (element)
{ {
if (need_comma) if (need_comma)
fputs_filtered (", ", stream); gdb_puts (", ", stream);
print_type_scalar (range, i, stream); print_type_scalar (range, i, stream);
need_comma = 1; need_comma = 1;
@ -381,7 +381,7 @@ pascal_language::value_print_inner (struct value *val,
{ {
int j = i; int j = i;
fputs_filtered ("..", stream); gdb_puts ("..", stream);
while (i + 1 <= high_bound while (i + 1 <= high_bound
&& value_bit_index (type, valaddr, ++i)) && value_bit_index (type, valaddr, ++i))
j = i; j = i;
@ -390,7 +390,7 @@ pascal_language::value_print_inner (struct value *val,
} }
} }
done: done:
fputs_filtered ("]", stream); gdb_puts ("]", stream);
} }
break; break;
@ -560,9 +560,9 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
{ {
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream); gdb_puts ("members of ", stream);
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (": ", stream); gdb_puts (": ", stream);
} }
} }
fields_seen = 1; fields_seen = 1;
@ -581,7 +581,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
if (field_is_static (&type->field (i))) if (field_is_static (&type->field (i)))
{ {
fputs_filtered ("static ", stream); gdb_puts ("static ", stream);
fprintf_symbol_filtered (stream, fprintf_symbol_filtered (stream,
type->field (i).name (), type->field (i).name (),
current_language->la_language, current_language->la_language,
@ -591,7 +591,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
annotate_field_name_end (); annotate_field_name_end ();
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
annotate_field_value (); annotate_field_value ();
if (!field_is_static (&type->field (i)) if (!field_is_static (&type->field (i))
@ -764,12 +764,12 @@ pascal_object_print_value (struct value *val, struct ui_file *stream,
fprintf_filtered (stream, "\n"); fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream); 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 /* Not sure what the best notation is in the case where there is no
baseclass name. */ baseclass name. */
fputs_filtered (basename ? basename : "", stream); gdb_puts (basename ? basename : "", stream);
fputs_filtered ("> = ", stream); gdb_puts ("> = ", stream);
if (skip < 0) if (skip < 0)
val_print_unavailable (stream); val_print_unavailable (stream);
@ -780,7 +780,7 @@ pascal_object_print_value (struct value *val, struct ui_file *stream,
(base_value, stream, recurse, options, (base_value, stream, recurse, options,
(struct type **) obstack_base (&dont_print_vb_obstack), (struct type **) obstack_base (&dont_print_vb_obstack),
0); 0);
fputs_filtered (", ", stream); gdb_puts (", ", stream);
flush_it: flush_it:
; ;

View file

@ -562,11 +562,11 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
&offset, &filename, &line, &unmapped)) &offset, &filename, &line, &unmapped))
return 0; return 0;
fputs_filtered (leadin, stream); gdb_puts (leadin, stream);
if (unmapped) if (unmapped)
fputs_filtered ("<*", stream); gdb_puts ("<*", stream);
else else
fputs_filtered ("<", stream); gdb_puts ("<", stream);
fputs_styled (name.c_str (), function_name_style.style (), stream); fputs_styled (name.c_str (), function_name_style.style (), stream);
if (offset != 0) if (offset != 0)
fprintf_filtered (stream, "%+d", offset); fprintf_filtered (stream, "%+d", offset);
@ -575,15 +575,15 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
line # of this addr, if we have it; else line # of the nearest symbol. */ line # of this addr, if we have it; else line # of the nearest symbol. */
if (print_symbol_filename && !filename.empty ()) if (print_symbol_filename && !filename.empty ())
{ {
fputs_filtered (line == -1 ? " in " : " at ", stream); gdb_puts (line == -1 ? " in " : " at ", stream);
fputs_styled (filename.c_str (), file_name_style.style (), stream); fputs_styled (filename.c_str (), file_name_style.style (), stream);
if (line != -1) if (line != -1)
fprintf_filtered (stream, ":%d", line); fprintf_filtered (stream, ":%d", line);
} }
if (unmapped) if (unmapped)
fputs_filtered ("*>", stream); gdb_puts ("*>", stream);
else else
fputs_filtered (">", stream); gdb_puts (">", stream);
return 1; return 1;
} }
@ -1150,7 +1150,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
} }
if (format == 'i') if (format == 'i')
puts_filtered (pc_prefix (next_address)); gdb_puts (pc_prefix (next_address));
print_address (next_gdbarch, next_address, gdb_stdout); print_address (next_gdbarch, next_address, gdb_stdout);
printf_filtered (":"); printf_filtered (":");
for (i = maxelts; for (i = maxelts;
@ -1678,7 +1678,7 @@ info_address_command (const char *exp, int from_tty)
} }
printf_filtered ("Symbol \""); printf_filtered ("Symbol \"");
puts_filtered (sym->print_name ()); gdb_puts (sym->print_name ());
printf_filtered ("\" is "); printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym); val = SYMBOL_VALUE (sym);
if (sym->is_objfile_owned ()) if (sym->is_objfile_owned ())
@ -2156,7 +2156,7 @@ do_one_display (struct display *d)
annotate_display_expression (); annotate_display_expression ();
puts_filtered (d->exp_string.c_str ()); gdb_puts (d->exp_string.c_str ());
annotate_display_expression_end (); annotate_display_expression_end ();
if (d->format.count != 1 || d->format.format == 'i') if (d->format.count != 1 || d->format.format == 'i')
@ -2195,7 +2195,7 @@ do_one_display (struct display *d)
annotate_display_expression (); annotate_display_expression ();
puts_filtered (d->exp_string.c_str ()); gdb_puts (d->exp_string.c_str ());
annotate_display_expression_end (); annotate_display_expression_end ();
printf_filtered (" = "); printf_filtered (" = ");
@ -2282,7 +2282,7 @@ Num Enb Expression\n"));
d->format.format); d->format.format);
else if (d->format.format) else if (d->format.format)
printf_filtered ("/%c ", d->format.format); printf_filtered ("/%c ", d->format.format);
puts_filtered (d->exp_string.c_str ()); gdb_puts (d->exp_string.c_str ());
if (d->block && !contained_in (get_selected_block (0), d->block, true)) if (d->block && !contained_in (get_selected_block (0), d->block, true))
printf_filtered (_(" (cannot be evaluated in the current context)")); printf_filtered (_(" (cannot be evaluated in the current context)"));
printf_filtered ("\n"); printf_filtered ("\n");
@ -2624,7 +2624,7 @@ printf_floating (struct ui_file *stream, const char *format,
/* Convert the value to a string and print it. */ /* Convert the value to a string and print it. */
std::string str std::string str
= target_float_to_string (value_contents (value).data (), fmt_type, format); = target_float_to_string (value_contents (value).data (), fmt_type, format);
fputs_filtered (str.c_str (), stream); gdb_puts (str.c_str (), stream);
} }
/* Subroutine of ui_printf to simplify it. /* Subroutine of ui_printf to simplify it.
@ -2862,7 +2862,7 @@ ui_printf (const char *arg, struct ui_file *stream)
/* Print a portion of the format string that has no /* Print a portion of the format string that has no
directives. Note that this will not include any directives. Note that this will not include any
ordinary %-specs, but it might include "%%". That is ordinary %-specs, but it might include "%%". That is
why we use printf_filtered and not puts_filtered here. why we use printf_filtered and not gdb_puts here.
Also, we pass a dummy argument because some platforms Also, we pass a dummy argument because some platforms
have modified GCC to include -Wformat-security by have modified GCC to include -Wformat-security by
default, which will warn here if there is no default, which will warn here if there is no

View file

@ -668,84 +668,84 @@ print_partial_symbols (struct gdbarch *gdbarch, struct objfile *objfile,
fprintf_filtered (outfile, " `%s'", fprintf_filtered (outfile, " `%s'",
p->ginfo.demangled_name ()); p->ginfo.demangled_name ());
} }
fputs_filtered (", ", outfile); gdb_puts (", ", outfile);
switch (p->domain) switch (p->domain)
{ {
case UNDEF_DOMAIN: case UNDEF_DOMAIN:
fputs_filtered ("undefined domain, ", outfile); gdb_puts ("undefined domain, ", outfile);
break; break;
case VAR_DOMAIN: case VAR_DOMAIN:
/* This is the usual thing -- don't print it. */ /* This is the usual thing -- don't print it. */
break; break;
case STRUCT_DOMAIN: case STRUCT_DOMAIN:
fputs_filtered ("struct domain, ", outfile); gdb_puts ("struct domain, ", outfile);
break; break;
case MODULE_DOMAIN: case MODULE_DOMAIN:
fputs_filtered ("module domain, ", outfile); gdb_puts ("module domain, ", outfile);
break; break;
case LABEL_DOMAIN: case LABEL_DOMAIN:
fputs_filtered ("label domain, ", outfile); gdb_puts ("label domain, ", outfile);
break; break;
case COMMON_BLOCK_DOMAIN: case COMMON_BLOCK_DOMAIN:
fputs_filtered ("common block domain, ", outfile); gdb_puts ("common block domain, ", outfile);
break; break;
default: default:
fputs_filtered ("<invalid domain>, ", outfile); gdb_puts ("<invalid domain>, ", outfile);
break; break;
} }
switch (p->aclass) switch (p->aclass)
{ {
case LOC_UNDEF: case LOC_UNDEF:
fputs_filtered ("undefined", outfile); gdb_puts ("undefined", outfile);
break; break;
case LOC_CONST: case LOC_CONST:
fputs_filtered ("constant int", outfile); gdb_puts ("constant int", outfile);
break; break;
case LOC_STATIC: case LOC_STATIC:
fputs_filtered ("static", outfile); gdb_puts ("static", outfile);
break; break;
case LOC_REGISTER: case LOC_REGISTER:
fputs_filtered ("register", outfile); gdb_puts ("register", outfile);
break; break;
case LOC_ARG: case LOC_ARG:
fputs_filtered ("pass by value", outfile); gdb_puts ("pass by value", outfile);
break; break;
case LOC_REF_ARG: case LOC_REF_ARG:
fputs_filtered ("pass by reference", outfile); gdb_puts ("pass by reference", outfile);
break; break;
case LOC_REGPARM_ADDR: case LOC_REGPARM_ADDR:
fputs_filtered ("register address parameter", outfile); gdb_puts ("register address parameter", outfile);
break; break;
case LOC_LOCAL: case LOC_LOCAL:
fputs_filtered ("stack parameter", outfile); gdb_puts ("stack parameter", outfile);
break; break;
case LOC_TYPEDEF: case LOC_TYPEDEF:
fputs_filtered ("type", outfile); gdb_puts ("type", outfile);
break; break;
case LOC_LABEL: case LOC_LABEL:
fputs_filtered ("label", outfile); gdb_puts ("label", outfile);
break; break;
case LOC_BLOCK: case LOC_BLOCK:
fputs_filtered ("function", outfile); gdb_puts ("function", outfile);
break; break;
case LOC_CONST_BYTES: case LOC_CONST_BYTES:
fputs_filtered ("constant bytes", outfile); gdb_puts ("constant bytes", outfile);
break; break;
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
fputs_filtered ("unresolved", outfile); gdb_puts ("unresolved", outfile);
break; break;
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:
fputs_filtered ("optimized out", outfile); gdb_puts ("optimized out", outfile);
break; break;
case LOC_COMPUTED: case LOC_COMPUTED:
fputs_filtered ("computed at runtime", outfile); gdb_puts ("computed at runtime", outfile);
break; break;
default: default:
fputs_filtered ("<invalid location>", outfile); gdb_puts ("<invalid location>", outfile);
break; break;
} }
fputs_filtered (", ", outfile); gdb_puts (", ", outfile);
fputs_filtered (paddress (gdbarch, p->unrelocated_address ()), outfile); gdb_puts (paddress (gdbarch, p->unrelocated_address ()), outfile);
fprintf_filtered (outfile, "\n"); fprintf_filtered (outfile, "\n");
} }
} }
@ -780,9 +780,9 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
host_address_to_string (psymtab->get_compunit_symtab (objfile))); host_address_to_string (psymtab->get_compunit_symtab (objfile)));
fprintf_filtered (outfile, " Symbols cover text addresses "); fprintf_filtered (outfile, " Symbols cover text addresses ");
fputs_filtered (paddress (gdbarch, psymtab->text_low (objfile)), outfile); gdb_puts (paddress (gdbarch, psymtab->text_low (objfile)), outfile);
fprintf_filtered (outfile, "-"); fprintf_filtered (outfile, "-");
fputs_filtered (paddress (gdbarch, psymtab->text_high (objfile)), outfile); gdb_puts (paddress (gdbarch, psymtab->text_high (objfile)), outfile);
fprintf_filtered (outfile, "\n"); fprintf_filtered (outfile, "\n");
fprintf_filtered (outfile, " Address map supported - %s.\n", fprintf_filtered (outfile, " Address map supported - %s.\n",
psymtab->psymtabs_addrmap_supported ? "yes" : "no"); psymtab->psymtabs_addrmap_supported ? "yes" : "no");
@ -1421,9 +1421,9 @@ partial_symtab::expand_dependencies (struct objfile *objfile)
/* Inform about additional files to be read in. */ /* Inform about additional files to be read in. */
if (info_verbose) if (info_verbose)
{ {
puts_filtered (" "); gdb_puts (" ");
gdb_stdout->wrap_here (0); gdb_stdout->wrap_here (0);
puts_filtered ("and "); gdb_puts ("and ");
gdb_stdout->wrap_here (0); gdb_stdout->wrap_here (0);
printf_filtered ("%s...", dependencies[i]->filename); printf_filtered ("%s...", dependencies[i]->filename);
gdb_stdout->wrap_here (0); /* Flush output */ gdb_stdout->wrap_here (0); /* Flush output */
@ -1696,10 +1696,10 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
psymtab->fullname psymtab->fullname
? psymtab->fullname : "(null)"); ? psymtab->fullname : "(null)");
printf_filtered (" text addresses "); printf_filtered (" text addresses ");
puts_filtered (paddress (gdbarch, gdb_puts (paddress (gdbarch,
psymtab->text_low (objfile))); psymtab->text_low (objfile)));
printf_filtered (" -- "); printf_filtered (" -- ");
puts_filtered (paddress (gdbarch, gdb_puts (paddress (gdbarch,
psymtab->text_high (objfile))); psymtab->text_high (objfile)));
printf_filtered ("\n"); printf_filtered ("\n");
printf_filtered (" psymtabs_addrmap_supported %s\n", printf_filtered (" psymtabs_addrmap_supported %s\n",
@ -1789,11 +1789,11 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
if (ps->text_high (objfile) < ps->text_low (objfile)) if (ps->text_high (objfile) < ps->text_low (objfile))
{ {
printf_filtered ("Psymtab "); printf_filtered ("Psymtab ");
puts_filtered (ps->filename); gdb_puts (ps->filename);
printf_filtered (" covers bad range "); printf_filtered (" covers bad range ");
puts_filtered (paddress (gdbarch, ps->text_low (objfile))); gdb_puts (paddress (gdbarch, ps->text_low (objfile)));
printf_filtered (" - "); printf_filtered (" - ");
puts_filtered (paddress (gdbarch, ps->text_high (objfile))); gdb_puts (paddress (gdbarch, ps->text_high (objfile)));
printf_filtered ("\n"); printf_filtered ("\n");
continue; continue;
} }
@ -1817,9 +1817,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
if (!sym) if (!sym)
{ {
printf_filtered ("Static symbol `"); printf_filtered ("Static symbol `");
puts_filtered (psym->ginfo.linkage_name ()); gdb_puts (psym->ginfo.linkage_name ());
printf_filtered ("' only found in "); printf_filtered ("' only found in ");
puts_filtered (ps->filename); gdb_puts (ps->filename);
printf_filtered (" psymtab\n"); printf_filtered (" psymtab\n");
} }
} }
@ -1832,9 +1832,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
if (!sym) if (!sym)
{ {
printf_filtered ("Global symbol `"); printf_filtered ("Global symbol `");
puts_filtered (psym->ginfo.linkage_name ()); gdb_puts (psym->ginfo.linkage_name ());
printf_filtered ("' only found in "); printf_filtered ("' only found in ");
puts_filtered (ps->filename); gdb_puts (ps->filename);
printf_filtered (" psymtab\n"); printf_filtered (" psymtab\n");
} }
} }
@ -1843,15 +1843,15 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
|| ps->text_high (objfile) > BLOCK_END (b))) || ps->text_high (objfile) > BLOCK_END (b)))
{ {
printf_filtered ("Psymtab "); printf_filtered ("Psymtab ");
puts_filtered (ps->filename); gdb_puts (ps->filename);
printf_filtered (" covers "); printf_filtered (" covers ");
puts_filtered (paddress (gdbarch, ps->text_low (objfile))); gdb_puts (paddress (gdbarch, ps->text_low (objfile)));
printf_filtered (" - "); printf_filtered (" - ");
puts_filtered (paddress (gdbarch, ps->text_high (objfile))); gdb_puts (paddress (gdbarch, ps->text_high (objfile)));
printf_filtered (" but symtab covers only "); printf_filtered (" but symtab covers only ");
puts_filtered (paddress (gdbarch, BLOCK_START (b))); gdb_puts (paddress (gdbarch, BLOCK_START (b)));
printf_filtered (" - "); printf_filtered (" - ");
puts_filtered (paddress (gdbarch, BLOCK_END (b))); gdb_puts (paddress (gdbarch, BLOCK_END (b)));
printf_filtered ("\n"); printf_filtered ("\n");
} }
} }

View file

@ -348,12 +348,12 @@ py_print_single_arg (struct ui_out *out,
{ {
string_file stb; string_file stb;
fputs_filtered (fa->sym->print_name (), &stb); gdb_puts (fa->sym->print_name (), &stb);
if (fa->entry_kind == print_entry_values_compact) if (fa->entry_kind == print_entry_values_compact)
{ {
stb.puts ("="); stb.puts ("=");
fputs_filtered (fa->sym->print_name (), &stb); gdb_puts (fa->sym->print_name (), &stb);
} }
if (fa->entry_kind == print_entry_values_only if (fa->entry_kind == print_entry_values_only
|| fa->entry_kind == print_entry_values_compact) || fa->entry_kind == print_entry_values_compact)

View file

@ -321,7 +321,7 @@ print_string_repr (PyObject *printer, const char *hint,
language->printstr (stream, type, (gdb_byte *) output, language->printstr (stream, type, (gdb_byte *) output,
length, NULL, 0, options); length, NULL, 0, options);
else else
fputs_filtered (output, stream); gdb_puts (output, stream);
} }
else else
{ {
@ -439,10 +439,10 @@ print_children (PyObject *printer, const char *hint,
if (i == 0) if (i == 0)
{ {
if (!is_py_none) if (!is_py_none)
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
else if (! is_map || i % 2 == 0) 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 /* Skip printing children if max_depth has been reached. This check
is performed after print_string_repr and the "=" separator so that is performed after print_string_repr and the "=" separator so that
@ -452,7 +452,7 @@ print_children (PyObject *printer, const char *hint,
return; return;
else if (i == 0) else if (i == 0)
/* Print initial "{" to bookend children. */ /* Print initial "{" to bookend children. */
fputs_filtered ("{", stream); gdb_puts ("{", stream);
/* In summary mode, we just want to print "= {...}" if there is /* In summary mode, we just want to print "= {...}" if there is
a value. */ a value. */
@ -470,7 +470,7 @@ print_children (PyObject *printer, const char *hint,
{ {
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
@ -478,7 +478,7 @@ print_children (PyObject *printer, const char *hint,
} }
if (is_map && i % 2 == 0) if (is_map && i % 2 == 0)
fputs_filtered ("[", stream); gdb_puts ("[", stream);
else if (is_array) else if (is_array)
{ {
/* We print the index, not whatever the child method /* We print the index, not whatever the child method
@ -488,8 +488,8 @@ print_children (PyObject *printer, const char *hint,
} }
else if (! is_map) else if (! is_map)
{ {
fputs_filtered (name, stream); gdb_puts (name, stream);
fputs_filtered (" = ", stream); gdb_puts (" = ", stream);
} }
if (gdbpy_is_lazy_string (py_v)) if (gdbpy_is_lazy_string (py_v))
@ -514,7 +514,7 @@ print_children (PyObject *printer, const char *hint,
if (!output) if (!output)
gdbpy_print_stack (); gdbpy_print_stack ();
else else
fputs_filtered (output.get (), stream); gdb_puts (output.get (), stream);
} }
else else
{ {
@ -540,7 +540,7 @@ print_children (PyObject *printer, const char *hint,
} }
if (is_map && i % 2 == 0) if (is_map && i % 2 == 0)
fputs_filtered ("] = ", stream); gdb_puts ("] = ", stream);
} }
if (i) if (i)
@ -549,17 +549,17 @@ print_children (PyObject *printer, const char *hint,
{ {
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
fputs_filtered ("...", stream); gdb_puts ("...", stream);
} }
if (pretty) if (pretty)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
} }

View file

@ -294,7 +294,7 @@ sim_inferior_data::~sim_inferior_data ()
static void static void
dump_mem (const gdb_byte *buf, int len) dump_mem (const gdb_byte *buf, int len)
{ {
fputs_unfiltered ("\t", gdb_stdlog); gdb_puts ("\t", gdb_stdlog);
if (len == 8 || len == 4) if (len == 8 || len == 4)
{ {
@ -313,7 +313,7 @@ dump_mem (const gdb_byte *buf, int len)
fprintf_unfiltered (gdb_stdlog, "0x%02x ", buf[i]); fprintf_unfiltered (gdb_stdlog, "0x%02x ", buf[i]);
} }
fputs_unfiltered ("\n", gdb_stdlog); gdb_puts ("\n", gdb_stdlog);
} }
/* Initialize gdb_callback. */ /* Initialize gdb_callback. */

View file

@ -1774,7 +1774,7 @@ show_memory_packet_size (struct memory_packet_config *config)
printf_filtered (_("Packets are limited to %ld bytes.\n"), printf_filtered (_("Packets are limited to %ld bytes.\n"),
remote->get_memory_packet_size (config)); remote->get_memory_packet_size (config));
else else
puts_filtered ("The actual limit will be further reduced " gdb_puts ("The actual limit will be further reduced "
"dependent on the target.\n"); "dependent on the target.\n");
} }
} }
@ -5782,9 +5782,9 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
if (from_tty) if (from_tty)
{ {
puts_filtered ("Remote debugging using "); gdb_puts ("Remote debugging using ");
puts_filtered (name); gdb_puts (name);
puts_filtered ("\n"); gdb_puts ("\n");
} }
/* Switch to using the remote target now. */ /* Switch to using the remote target now. */
@ -5960,7 +5960,7 @@ remote_target::remote_detach_1 (inferior *inf, int from_tty)
/* Exit only if this is the only active inferior. */ /* Exit only if this is the only active inferior. */
if (from_tty && !rs->extended && number_of_live_inferiors (this) == 1) if (from_tty && !rs->extended && number_of_live_inferiors (this) == 1)
puts_filtered (_("Ending remote debugging.\n")); gdb_puts (_("Ending remote debugging.\n"));
/* See if any thread of the inferior we are detaching has a pending fork /* See if any thread of the inferior we are detaching has a pending fork
status. In that case, we must detach from the child resulting from status. In that case, we must detach from the child resulting from
@ -6093,7 +6093,7 @@ remote_target::disconnect (const char *args, int from_tty)
remote_unpush_target (this); remote_unpush_target (this);
if (from_tty) if (from_tty)
puts_filtered ("Ending remote debugging.\n"); gdb_puts ("Ending remote debugging.\n");
} }
/* Attach to the process specified by ARGS. If FROM_TTY is non-zero, /* Attach to the process specified by ARGS. If FROM_TTY is non-zero,
@ -11601,18 +11601,18 @@ struct cli_packet_command_callbacks : public send_remote_packet_callbacks
void sending (gdb::array_view<const char> &buf) override void sending (gdb::array_view<const char> &buf) override
{ {
puts_filtered ("sending: "); gdb_puts ("sending: ");
print_packet (buf); print_packet (buf);
puts_filtered ("\n"); gdb_puts ("\n");
} }
/* Called with BUF, the reply from the remote target. */ /* Called with BUF, the reply from the remote target. */
void received (gdb::array_view<const char> &buf) override void received (gdb::array_view<const char> &buf) override
{ {
puts_filtered ("received: \""); gdb_puts ("received: \"");
print_packet (buf); print_packet (buf);
puts_filtered ("\"\n"); gdb_puts ("\"\n");
} }
private: private:
@ -11634,7 +11634,7 @@ private:
fprintf_unfiltered (&stb, "\\x%02x", (unsigned char) c); fprintf_unfiltered (&stb, "\\x%02x", (unsigned char) c);
} }
puts_filtered (stb.string ().c_str ()); gdb_puts (stb.string ().c_str ());
} }
}; };

View file

@ -1037,7 +1037,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
int print_raw_format; int print_raw_format;
enum tab_stops { value_column_1 = 15 }; enum tab_stops { value_column_1 = 15 };
fputs_filtered (name, file); gdb_puts (name, file);
print_spaces_filtered (value_column_1 - strlen (name), file); print_spaces_filtered (value_column_1 - strlen (name), file);
try try

View file

@ -349,13 +349,13 @@ rust_language::val_print_struct
return; return;
if (type->name () != NULL) if (type->name () != NULL)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
if (is_tuple || is_tuple_struct) if (is_tuple || is_tuple_struct)
fputs_filtered ("(", stream); gdb_puts ("(", stream);
else else
fputs_filtered ("{", stream); gdb_puts ("{", stream);
opts = *options; opts = *options;
opts.deref_ref = 0; opts.deref_ref = 0;
@ -367,15 +367,15 @@ rust_language::val_print_struct
continue; continue;
if (!first_field) if (!first_field)
fputs_filtered (",", stream); gdb_puts (",", stream);
if (options->prettyformat) if (options->prettyformat)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else if (!first_field) else if (!first_field)
fputs_filtered (" ", stream); gdb_puts (" ", stream);
first_field = 0; first_field = 0;
@ -383,7 +383,7 @@ rust_language::val_print_struct
{ {
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
fputs_filtered (": ", stream); gdb_puts (": ", stream);
} }
common_val_print (value_field (val, i), stream, recurse + 1, &opts, common_val_print (value_field (val, i), stream, recurse + 1, &opts,
@ -392,14 +392,14 @@ rust_language::val_print_struct
if (options->prettyformat) if (options->prettyformat)
{ {
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
if (is_tuple || is_tuple_struct) if (is_tuple || is_tuple_struct)
fputs_filtered (")", stream); gdb_puts (")", stream);
else else
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
/* See rust-lang.h. */ /* See rust-lang.h. */
@ -458,7 +458,7 @@ rust_language::print_enum (struct value *val, struct ui_file *stream,
for (int j = 0; j < variant_type->num_fields (); j++) for (int j = 0; j < variant_type->num_fields (); j++)
{ {
if (!first_field) if (!first_field)
fputs_filtered (", ", stream); gdb_puts (", ", stream);
first_field = false; first_field = false;
if (!is_tuple) if (!is_tuple)
@ -471,9 +471,9 @@ rust_language::print_enum (struct value *val, struct ui_file *stream,
} }
if (is_tuple) if (is_tuple)
fputs_filtered (")", stream); gdb_puts (")", stream);
else else
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
static const struct generic_val_print_decorations rust_decorations = static const struct generic_val_print_decorations rust_decorations =
@ -524,11 +524,11 @@ rust_language::value_print_inner
if (opts.addressprint) if (opts.addressprint)
{ {
fputs_filtered (paddress (arch, addr), stream); gdb_puts (paddress (arch, addr), stream);
fputs_filtered (" ", stream); gdb_puts (" ", stream);
} }
fputs_filtered ("b", stream); gdb_puts ("b", stream);
val_print_string (TYPE_TARGET_TYPE (elttype), "ASCII", addr, val_print_string (TYPE_TARGET_TYPE (elttype), "ASCII", addr,
high_bound - low_bound + 1, stream, high_bound - low_bound + 1, stream,
&opts); &opts);
@ -542,7 +542,7 @@ rust_language::value_print_inner
if (type->is_unsigned () && TYPE_LENGTH (type) == 0 if (type->is_unsigned () && TYPE_LENGTH (type) == 0
&& type->name () != NULL && strcmp (type->name (), "()") == 0) && type->name () != NULL && strcmp (type->name (), "()") == 0)
{ {
fputs_filtered ("()", stream); gdb_puts ("()", stream);
break; break;
} }
goto generic_print; goto generic_print;
@ -557,7 +557,7 @@ rust_language::value_print_inner
/* If we see a plain TYPE_CODE_STRING, then we're printing a /* If we see a plain TYPE_CODE_STRING, then we're printing a
byte string, hence the choice of "ASCII" as the byte string, hence the choice of "ASCII" as the
encoding. */ encoding. */
fputs_filtered ("b", stream); gdb_puts ("b", stream);
printstr (stream, TYPE_TARGET_TYPE (type), printstr (stream, TYPE_TARGET_TYPE (type),
value_contents_for_printing (val).data (), value_contents_for_printing (val).data (),
high_bound - low_bound + 1, "ASCII", 0, &opts); high_bound - low_bound + 1, "ASCII", 0, &opts);
@ -570,7 +570,7 @@ rust_language::value_print_inner
if (get_array_bounds (type, &low_bound, &high_bound) if (get_array_bounds (type, &low_bound, &high_bound)
&& high_bound - low_bound + 1 == 0) && high_bound - low_bound + 1 == 0)
fputs_filtered ("[]", stream); gdb_puts ("[]", stream);
else else
goto generic_print; goto generic_print;
} }
@ -617,7 +617,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
/* Print a tuple type simply. */ /* Print a tuple type simply. */
if (rust_tuple_type_p (type)) if (rust_tuple_type_p (type))
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
return; return;
} }
@ -648,26 +648,26 @@ rust_print_struct_def (struct type *type, const char *varstring,
/* This code path is also used by unions and enums. */ /* This code path is also used by unions and enums. */
if (is_enum) if (is_enum)
{ {
fputs_filtered ("enum ", stream); gdb_puts ("enum ", stream);
dynamic_prop *prop = type->dyn_prop (DYN_PROP_VARIANT_PARTS); dynamic_prop *prop = type->dyn_prop (DYN_PROP_VARIANT_PARTS);
if (prop != nullptr && prop->kind () == PROP_TYPE) if (prop != nullptr && prop->kind () == PROP_TYPE)
type = prop->original_type (); type = prop->original_type ();
} }
else if (type->code () == TYPE_CODE_STRUCT) else if (type->code () == TYPE_CODE_STRUCT)
fputs_filtered ("struct ", stream); gdb_puts ("struct ", stream);
else else
fputs_filtered ("union ", stream); gdb_puts ("union ", stream);
if (tagname != NULL) if (tagname != NULL)
fputs_filtered (tagname, stream); gdb_puts (tagname, stream);
} }
if (type->num_fields () == 0 && !is_tuple) if (type->num_fields () == 0 && !is_tuple)
return; return;
if (for_rust_enum && !flags->print_offsets) if (for_rust_enum && !flags->print_offsets)
fputs_filtered (is_tuple_struct ? "(" : "{", stream); gdb_puts (is_tuple_struct ? "(" : "{", stream);
else else
fputs_filtered (is_tuple_struct ? " (\n" : " {\n", stream); gdb_puts (is_tuple_struct ? " (\n" : " {\n", stream);
/* When printing offsets, we rearrange the fields into storage /* When printing offsets, we rearrange the fields into storage
order. This lets us show holes more clearly. We work using order. This lets us show holes more clearly. We work using
@ -720,12 +720,12 @@ rust_print_struct_def (struct type *type, const char *varstring,
stream, (is_enum ? show : show - 1), stream, (is_enum ? show : show - 1),
level + 2, flags, is_enum, podata); level + 2, flags, is_enum, podata);
if (!for_rust_enum || flags->print_offsets) if (!for_rust_enum || flags->print_offsets)
fputs_filtered (",\n", stream); gdb_puts (",\n", stream);
/* Note that this check of "I" is ok because we only sorted the /* Note that this check of "I" is ok because we only sorted the
fields by offset when print_offsets was set, so we won't take fields by offset when print_offsets was set, so we won't take
this branch in that case. */ this branch in that case. */
else if (i + 1 < type->num_fields ()) else if (i + 1 < type->num_fields ())
fputs_filtered (", ", stream); gdb_puts (", ", stream);
} }
if (flags->print_offsets) if (flags->print_offsets)
@ -739,7 +739,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
} }
if (!for_rust_enum || flags->print_offsets) if (!for_rust_enum || flags->print_offsets)
print_spaces_filtered (level, stream); print_spaces_filtered (level, stream);
fputs_filtered (is_tuple_struct ? ")" : "}", stream); gdb_puts (is_tuple_struct ? ")" : "}", stream);
} }
/* la_print_type implementation for Rust. */ /* la_print_type implementation for Rust. */
@ -757,9 +757,9 @@ rust_internal_print_type (struct type *type, const char *varstring,
/* Rust calls the unit type "void" in its debuginfo, /* Rust calls the unit type "void" in its debuginfo,
but we don't want to print it as that. */ but we don't want to print it as that. */
if (type->code () == TYPE_CODE_VOID) if (type->code () == TYPE_CODE_VOID)
fputs_filtered ("()", stream); gdb_puts ("()", stream);
else else
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
return; return;
} }
@ -771,7 +771,7 @@ rust_internal_print_type (struct type *type, const char *varstring,
unqualified name, and there is nothing else to print unqualified name, and there is nothing else to print
here. */ here. */
if (!for_rust_enum) if (!for_rust_enum)
fputs_filtered ("()", stream); gdb_puts ("()", stream);
break; break;
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
@ -779,23 +779,23 @@ rust_internal_print_type (struct type *type, const char *varstring,
if (type->has_varargs ()) if (type->has_varargs ())
goto c_printer; goto c_printer;
fputs_filtered ("fn ", stream); gdb_puts ("fn ", stream);
if (varstring != NULL) if (varstring != NULL)
fputs_filtered (varstring, stream); gdb_puts (varstring, stream);
fputs_filtered ("(", stream); gdb_puts ("(", stream);
for (int i = 0; i < type->num_fields (); ++i) for (int i = 0; i < type->num_fields (); ++i)
{ {
QUIT; QUIT;
if (i > 0) if (i > 0)
fputs_filtered (", ", stream); gdb_puts (", ", stream);
rust_internal_print_type (type->field (i).type (), "", stream, rust_internal_print_type (type->field (i).type (), "", stream,
-1, 0, flags, false, podata); -1, 0, flags, false, podata);
} }
fputs_filtered (")", stream); gdb_puts (")", stream);
/* If it returns unit, we can omit the return type. */ /* If it returns unit, we can omit the return type. */
if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
{ {
fputs_filtered (" -> ", stream); gdb_puts (" -> ", stream);
rust_internal_print_type (TYPE_TARGET_TYPE (type), "", stream, rust_internal_print_type (TYPE_TARGET_TYPE (type), "", stream,
-1, 0, flags, false, podata); -1, 0, flags, false, podata);
} }
@ -805,7 +805,7 @@ rust_internal_print_type (struct type *type, const char *varstring,
{ {
LONGEST low_bound, high_bound; LONGEST low_bound, high_bound;
fputs_filtered ("[", stream); gdb_puts ("[", stream);
rust_internal_print_type (TYPE_TARGET_TYPE (type), NULL, rust_internal_print_type (TYPE_TARGET_TYPE (type), NULL,
stream, show - 1, level, flags, false, stream, show - 1, level, flags, false,
podata); podata);
@ -816,7 +816,7 @@ rust_internal_print_type (struct type *type, const char *varstring,
else if (get_array_bounds (type, &low_bound, &high_bound)) else if (get_array_bounds (type, &low_bound, &high_bound))
fprintf_filtered (stream, "; %s", fprintf_filtered (stream, "; %s",
plongest (high_bound - low_bound + 1)); plongest (high_bound - low_bound + 1));
fputs_filtered ("]", stream); gdb_puts ("]", stream);
} }
break; break;
@ -830,14 +830,14 @@ rust_internal_print_type (struct type *type, const char *varstring,
{ {
int len = 0; int len = 0;
fputs_filtered ("enum ", stream); gdb_puts ("enum ", stream);
if (type->name () != NULL) if (type->name () != NULL)
{ {
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
fputs_filtered (" ", stream); gdb_puts (" ", stream);
len = strlen (type->name ()); len = strlen (type->name ());
} }
fputs_filtered ("{\n", stream); gdb_puts ("{\n", stream);
for (int i = 0; i < type->num_fields (); ++i) for (int i = 0; i < type->num_fields (); ++i)
{ {
@ -856,19 +856,19 @@ rust_internal_print_type (struct type *type, const char *varstring,
name)); name));
} }
fputs_filtered ("}", stream); gdb_puts ("}", stream);
} }
break; break;
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
{ {
if (type->name () != nullptr) if (type->name () != nullptr)
fputs_filtered (type->name (), stream); gdb_puts (type->name (), stream);
else else
{ {
/* We currently can't distinguish between pointers and /* We currently can't distinguish between pointers and
references. */ references. */
fputs_filtered ("*mut ", stream); gdb_puts ("*mut ", stream);
type_print (TYPE_TARGET_TYPE (type), "", stream, 0); type_print (TYPE_TARGET_TYPE (type), "", stream, 0);
} }
} }
@ -1600,13 +1600,13 @@ rust_language::emitchar (int ch, struct type *chtype,
else if (ch == '\\' || ch == quoter) else if (ch == '\\' || ch == quoter)
fprintf_filtered (stream, "\\%c", ch); fprintf_filtered (stream, "\\%c", ch);
else if (ch == '\n') else if (ch == '\n')
fputs_filtered ("\\n", stream); gdb_puts ("\\n", stream);
else if (ch == '\r') else if (ch == '\r')
fputs_filtered ("\\r", stream); gdb_puts ("\\r", stream);
else if (ch == '\t') else if (ch == '\t')
fputs_filtered ("\\t", stream); gdb_puts ("\\t", stream);
else if (ch == '\0') else if (ch == '\0')
fputs_filtered ("\\0", stream); gdb_puts ("\\0", stream);
else if (ch >= 32 && ch <= 127 && isprint (ch)) else if (ch >= 32 && ch <= 127 && isprint (ch))
fputc_filtered (ch, stream); fputc_filtered (ch, stream);
else if (ch <= 255) else if (ch <= 255)

View file

@ -178,9 +178,9 @@ public:
void printchar (int ch, struct type *chtype, void printchar (int ch, struct type *chtype,
struct ui_file *stream) const override struct ui_file *stream) const override
{ {
fputs_filtered ("'", stream); gdb_puts ("'", stream);
emitchar (ch, chtype, stream, '\''); emitchar (ch, chtype, stream, '\'');
fputs_filtered ("'", stream); gdb_puts ("'", stream);
} }
/* See language.h. */ /* See language.h. */

View file

@ -518,7 +518,7 @@ s12z_print_ccw_info (struct gdbarch *gdbarch,
struct value *v = value_of_register (reg, frame); struct value *v = value_of_register (reg, frame);
const char *name = gdbarch_register_name (gdbarch, reg); const char *name = gdbarch_register_name (gdbarch, reg);
uint32_t ccw = value_as_long (v); uint32_t ccw = value_as_long (v);
fputs_filtered (name, file); gdb_puts (name, file);
size_t len = strlen (name); size_t len = strlen (name);
const int stop_1 = 15; const int stop_1 = 15;
const int stop_2 = 17; const int stop_2 = 17;

View file

@ -306,12 +306,12 @@ ser_base_read_error_fd (struct serial *scb, int close_fd)
while ((newline = strstr (current, "\n")) != NULL) while ((newline = strstr (current, "\n")) != NULL)
{ {
*newline = '\0'; *newline = '\0';
fputs_unfiltered (current, gdb_stderr); gdb_puts (current, gdb_stderr);
fputs_unfiltered ("\n", gdb_stderr); gdb_puts ("\n", gdb_stderr);
current = newline + 1; current = newline + 1;
} }
fputs_unfiltered (current, gdb_stderr); gdb_puts (current, gdb_stderr);
} }
} }
} }

View file

@ -81,10 +81,10 @@ serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout)
fprintf_unfiltered (stream, "<Error: %s>", safe_strerror (errno)); fprintf_unfiltered (stream, "<Error: %s>", safe_strerror (errno));
return; return;
case SERIAL_EOF: case SERIAL_EOF:
fputs_unfiltered ("<Eof>", stream); gdb_puts ("<Eof>", stream);
return; return;
case SERIAL_BREAK: case SERIAL_BREAK:
fputs_unfiltered ("<Break>", stream); gdb_puts ("<Break>", stream);
return; return;
default: default:
if (serial_logbase == logbase_hex) if (serial_logbase == logbase_hex)
@ -95,25 +95,25 @@ serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout)
switch (ch) switch (ch)
{ {
case '\\': case '\\':
fputs_unfiltered ("\\\\", stream); gdb_puts ("\\\\", stream);
break; break;
case '\b': case '\b':
fputs_unfiltered ("\\b", stream); gdb_puts ("\\b", stream);
break; break;
case '\f': case '\f':
fputs_unfiltered ("\\f", stream); gdb_puts ("\\f", stream);
break; break;
case '\n': case '\n':
fputs_unfiltered ("\\n", stream); gdb_puts ("\\n", stream);
break; break;
case '\r': case '\r':
fputs_unfiltered ("\\r", stream); gdb_puts ("\\r", stream);
break; break;
case '\t': case '\t':
fputs_unfiltered ("\\t", stream); gdb_puts ("\\t", stream);
break; break;
case '\v': case '\v':
fputs_unfiltered ("\\v", stream); gdb_puts ("\\v", stream);
break; break;
default: default:
fprintf_unfiltered (stream, fprintf_unfiltered (stream,
@ -131,8 +131,8 @@ serial_log_command (struct target_ops *self, const char *cmd)
serial_current_type = 'c'; serial_current_type = 'c';
fputs_unfiltered ("\nc ", serial_logfp); gdb_puts ("\nc ", serial_logfp);
fputs_unfiltered (cmd, serial_logfp); gdb_puts (cmd, serial_logfp);
/* Make sure that the log file is as up-to-date as possible, /* Make sure that the log file is as up-to-date as possible,
in case we are getting ready to dump core or something. */ in case we are getting ready to dump core or something. */
@ -312,7 +312,7 @@ do_serial_close (struct serial *scb, int really_close)
if (serial_logfp) if (serial_logfp)
{ {
fputs_unfiltered ("\nEnd of log\n", serial_logfp); gdb_puts ("\nEnd of log\n", serial_logfp);
serial_current_type = 0; serial_current_type = 0;
/* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */ /* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */

View file

@ -403,9 +403,9 @@ set_directories_command (const char *args,
static void static void
show_directories_1 (ui_file *file, char *ignore, int from_tty) show_directories_1 (ui_file *file, char *ignore, int from_tty)
{ {
fputs_filtered ("Source directories searched: ", file); gdb_puts ("Source directories searched: ", file);
fputs_filtered (source_path.c_str (), file); gdb_puts (source_path.c_str (), file);
fputs_filtered ("\n", file); gdb_puts ("\n", file);
} }
/* Handler for "show directories" command. */ /* Handler for "show directories" command. */

View file

@ -428,14 +428,14 @@ print_frame_arg (const frame_print_options &fp_opts,
annotate_arg_emitter arg_emitter; annotate_arg_emitter arg_emitter;
ui_out_emit_tuple tuple_emitter (uiout, NULL); ui_out_emit_tuple tuple_emitter (uiout, NULL);
fputs_filtered (arg->sym->print_name (), &stb); gdb_puts (arg->sym->print_name (), &stb);
if (arg->entry_kind == print_entry_values_compact) if (arg->entry_kind == print_entry_values_compact)
{ {
/* It is OK to provide invalid MI-like stream as with /* It is OK to provide invalid MI-like stream as with
PRINT_ENTRY_VALUE_COMPACT we never use MI. */ PRINT_ENTRY_VALUE_COMPACT we never use MI. */
stb.puts ("="); stb.puts ("=");
fputs_filtered (arg->sym->print_name (), &stb); gdb_puts (arg->sym->print_name (), &stb);
} }
if (arg->entry_kind == print_entry_values_only if (arg->entry_kind == print_entry_values_only
|| arg->entry_kind == print_entry_values_compact) || arg->entry_kind == print_entry_values_compact)
@ -1366,7 +1366,7 @@ print_frame (const frame_print_options &fp_opts,
annotate_frame_function_name (); annotate_frame_function_name ();
string_file stb; string_file stb;
fputs_filtered (funname ? funname.get () : "??", &stb); gdb_puts (funname ? funname.get () : "??", &stb);
uiout->field_stream ("func", stb, function_name_style.style ()); uiout->field_stream ("func", stb, function_name_style.style ());
uiout->wrap_hint (3); uiout->wrap_hint (3);
annotate_frame_args (); annotate_frame_args ();
@ -1549,11 +1549,11 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
{ {
printf_filtered (_("Stack frame at ")); printf_filtered (_("Stack frame at "));
} }
puts_filtered (paddress (gdbarch, get_frame_base (fi))); gdb_puts (paddress (gdbarch, get_frame_base (fi)));
printf_filtered (":\n"); printf_filtered (":\n");
printf_filtered (" %s = ", pc_regname); printf_filtered (" %s = ", pc_regname);
if (frame_pc_p) if (frame_pc_p)
puts_filtered (paddress (gdbarch, get_frame_pc (fi))); gdb_puts (paddress (gdbarch, get_frame_pc (fi)));
else else
fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout); fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout);
@ -1561,7 +1561,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
if (funname) if (funname)
{ {
printf_filtered (" in "); printf_filtered (" in ");
puts_filtered (funname); gdb_puts (funname);
} }
gdb_stdout->wrap_here (3); gdb_stdout->wrap_here (3);
if (sal.symtab) if (sal.symtab)
@ -1570,7 +1570,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
symtab_to_filename_for_display (sal.symtab)), symtab_to_filename_for_display (sal.symtab)),
sal.line); sal.line);
puts_filtered ("; "); gdb_puts ("; ");
gdb_stdout->wrap_here (4); gdb_stdout->wrap_here (4);
printf_filtered ("saved %s = ", pc_regname); printf_filtered ("saved %s = ", pc_regname);
@ -1603,7 +1603,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
} }
if (caller_pc_p) if (caller_pc_p)
puts_filtered (paddress (gdbarch, caller_pc)); gdb_puts (paddress (gdbarch, caller_pc));
printf_filtered ("\n"); printf_filtered ("\n");
if (calling_frame_info == NULL) if (calling_frame_info == NULL)
@ -1616,25 +1616,25 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
frame_stop_reason_string (fi)); frame_stop_reason_string (fi));
} }
else if (get_frame_type (fi) == TAILCALL_FRAME) else if (get_frame_type (fi) == TAILCALL_FRAME)
puts_filtered (" tail call frame"); gdb_puts (" tail call frame");
else if (get_frame_type (fi) == INLINE_FRAME) else if (get_frame_type (fi) == INLINE_FRAME)
printf_filtered (" inlined into frame %d", printf_filtered (" inlined into frame %d",
frame_relative_level (get_prev_frame (fi))); frame_relative_level (get_prev_frame (fi)));
else else
{ {
printf_filtered (" called by frame at "); printf_filtered (" called by frame at ");
puts_filtered (paddress (gdbarch, get_frame_base (calling_frame_info))); gdb_puts (paddress (gdbarch, get_frame_base (calling_frame_info)));
} }
if (get_next_frame (fi) && calling_frame_info) if (get_next_frame (fi) && calling_frame_info)
puts_filtered (","); gdb_puts (",");
gdb_stdout->wrap_here (3); gdb_stdout->wrap_here (3);
if (get_next_frame (fi)) if (get_next_frame (fi))
{ {
printf_filtered (" caller of frame at "); printf_filtered (" caller of frame at ");
puts_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi)))); gdb_puts (paddress (gdbarch, get_frame_base (get_next_frame (fi))));
} }
if (get_next_frame (fi) || calling_frame_info) if (get_next_frame (fi) || calling_frame_info)
puts_filtered ("\n"); gdb_puts ("\n");
if (s) if (s)
printf_filtered (" source language %s.\n", printf_filtered (" source language %s.\n",
@ -1651,28 +1651,28 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
else else
{ {
printf_filtered (" Arglist at "); printf_filtered (" Arglist at ");
puts_filtered (paddress (gdbarch, arg_list)); gdb_puts (paddress (gdbarch, arg_list));
printf_filtered (","); printf_filtered (",");
if (!gdbarch_frame_num_args_p (gdbarch)) if (!gdbarch_frame_num_args_p (gdbarch))
{ {
numargs = -1; numargs = -1;
puts_filtered (" args: "); gdb_puts (" args: ");
} }
else else
{ {
numargs = gdbarch_frame_num_args (gdbarch, fi); numargs = gdbarch_frame_num_args (gdbarch, fi);
gdb_assert (numargs >= 0); gdb_assert (numargs >= 0);
if (numargs == 0) if (numargs == 0)
puts_filtered (" no args."); gdb_puts (" no args.");
else if (numargs == 1) else if (numargs == 1)
puts_filtered (" 1 arg: "); gdb_puts (" 1 arg: ");
else else
printf_filtered (" %d args: ", numargs); printf_filtered (" %d args: ", numargs);
} }
print_frame_args (user_frame_print_options, print_frame_args (user_frame_print_options,
func, fi, numargs, gdb_stdout); func, fi, numargs, gdb_stdout);
puts_filtered ("\n"); gdb_puts ("\n");
} }
} }
{ {
@ -1684,7 +1684,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
else else
{ {
printf_filtered (" Locals at "); printf_filtered (" Locals at ");
puts_filtered (paddress (gdbarch, arg_list)); gdb_puts (paddress (gdbarch, arg_list));
printf_filtered (","); printf_filtered (",");
} }
} }
@ -1719,13 +1719,13 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
(value_contents_all (value).data (), sp_size, byte_order); (value_contents_all (value).data (), sp_size, byte_order);
printf_filtered (" Previous frame's sp is "); printf_filtered (" Previous frame's sp is ");
puts_filtered (paddress (gdbarch, sp)); gdb_puts (paddress (gdbarch, sp));
printf_filtered ("\n"); printf_filtered ("\n");
} }
else if (VALUE_LVAL (value) == lval_memory) else if (VALUE_LVAL (value) == lval_memory)
{ {
printf_filtered (" Previous frame's sp at "); printf_filtered (" Previous frame's sp at ");
puts_filtered (paddress (gdbarch, value_address (value))); gdb_puts (paddress (gdbarch, value_address (value)));
printf_filtered ("\n"); printf_filtered ("\n");
} }
else if (VALUE_LVAL (value) == lval_register) else if (VALUE_LVAL (value) == lval_register)
@ -1762,18 +1762,18 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
if (!optimized && !unavailable && lval == lval_memory) if (!optimized && !unavailable && lval == lval_memory)
{ {
if (count == 0) if (count == 0)
puts_filtered (" Saved registers:\n "); gdb_puts (" Saved registers:\n ");
else else
puts_filtered (","); gdb_puts (",");
gdb_stdout->wrap_here (1); gdb_stdout->wrap_here (1);
printf_filtered (" %s at ", printf_filtered (" %s at ",
gdbarch_register_name (gdbarch, i)); gdbarch_register_name (gdbarch, i));
puts_filtered (paddress (gdbarch, addr)); gdb_puts (paddress (gdbarch, addr));
count++; count++;
} }
} }
if (count || need_nl) if (count || need_nl)
puts_filtered ("\n"); gdb_puts ("\n");
} }
} }

View file

@ -3202,14 +3202,14 @@ list_overlays_command (const char *args, int from_tty)
name = bfd_section_name (osect->the_bfd_section); name = bfd_section_name (osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name); printf_filtered ("Section %s, loaded at ", name);
puts_filtered (paddress (gdbarch, lma)); gdb_puts (paddress (gdbarch, lma));
puts_filtered (" - "); gdb_puts (" - ");
puts_filtered (paddress (gdbarch, lma + size)); gdb_puts (paddress (gdbarch, lma + size));
printf_filtered (", mapped at "); printf_filtered (", mapped at ");
puts_filtered (paddress (gdbarch, vma)); gdb_puts (paddress (gdbarch, vma));
puts_filtered (" - "); gdb_puts (" - ");
puts_filtered (paddress (gdbarch, vma + size)); gdb_puts (paddress (gdbarch, vma + size));
puts_filtered ("\n"); gdb_puts ("\n");
nmapped++; nmapped++;
} }

View file

@ -203,7 +203,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
not try to respect copy relocations. */ not try to respect copy relocations. */
CORE_ADDR addr = (msymbol->value.address CORE_ADDR addr = (msymbol->value.address
+ objfile->section_offsets[msymbol->section_index ()]); + objfile->section_offsets[msymbol->section_index ()]);
fputs_filtered (paddress (gdbarch, addr), outfile); gdb_puts (paddress (gdbarch, addr), outfile);
fprintf_filtered (outfile, " %s", msymbol->linkage_name ()); fprintf_filtered (outfile, " %s", msymbol->linkage_name ());
if (section) if (section)
{ {
@ -220,7 +220,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
} }
if (msymbol->filename) if (msymbol->filename)
fprintf_filtered (outfile, " %s", msymbol->filename); fprintf_filtered (outfile, " %s", msymbol->filename);
fputs_filtered ("\n", outfile); gdb_puts ("\n", outfile);
index++; index++;
} }
if (objfile->per_bfd->minimal_symbol_count != index) if (objfile->per_bfd->minimal_symbol_count != index)
@ -267,7 +267,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
fprintf_filtered (outfile, " line %d at ", l->item[i].line); fprintf_filtered (outfile, " line %d at ", l->item[i].line);
fputs_filtered (paddress (gdbarch, l->item[i].pc), outfile); gdb_puts (paddress (gdbarch, l->item[i].pc), outfile);
if (l->item[i].is_stmt) if (l->item[i].is_stmt)
fprintf_filtered (outfile, "\t(stmt)"); fprintf_filtered (outfile, "\t(stmt)");
fprintf_filtered (outfile, "\n"); fprintf_filtered (outfile, "\n");
@ -295,9 +295,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
wants it. */ wants it. */
fprintf_filtered (outfile, ", %d syms/buckets in ", fprintf_filtered (outfile, ", %d syms/buckets in ",
mdict_size (BLOCK_MULTIDICT (b))); mdict_size (BLOCK_MULTIDICT (b)));
fputs_filtered (paddress (gdbarch, BLOCK_START (b)), outfile); gdb_puts (paddress (gdbarch, BLOCK_START (b)), outfile);
fprintf_filtered (outfile, ".."); fprintf_filtered (outfile, "..");
fputs_filtered (paddress (gdbarch, BLOCK_END (b)), outfile); gdb_puts (paddress (gdbarch, BLOCK_END (b)), outfile);
if (BLOCK_FUNCTION (b)) if (BLOCK_FUNCTION (b))
{ {
fprintf_filtered (outfile, ", function %s", fprintf_filtered (outfile, ", function %s",
@ -511,7 +511,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
if (symbol->domain () == LABEL_DOMAIN) if (symbol->domain () == LABEL_DOMAIN)
{ {
fprintf_filtered (outfile, "label %s at ", symbol->print_name ()); fprintf_filtered (outfile, "label %s at ", symbol->print_name ());
fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)), gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
outfile); outfile);
if (section) if (section)
fprintf_filtered (outfile, " section %s\n", fprintf_filtered (outfile, " section %s\n",
@ -581,7 +581,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
case LOC_STATIC: case LOC_STATIC:
fprintf_filtered (outfile, "static at "); fprintf_filtered (outfile, "static at ");
fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)), gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
outfile); outfile);
if (section) if (section)
fprintf_filtered (outfile, " section %s", fprintf_filtered (outfile, " section %s",
@ -622,7 +622,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
case LOC_LABEL: case LOC_LABEL:
fprintf_filtered (outfile, "label at "); fprintf_filtered (outfile, "label at ");
fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)), gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
outfile); outfile);
if (section) if (section)
fprintf_filtered (outfile, " section %s", fprintf_filtered (outfile, " section %s",

View file

@ -5102,7 +5102,7 @@ print_symbol_info (enum search_domain kind,
if (sym->line () != 0) if (sym->line () != 0)
printf_filtered ("%d:\t", sym->line ()); printf_filtered ("%d:\t", sym->line ());
else else
puts_filtered ("\t"); gdb_puts ("\t");
} }
std::string str = symbol_to_info_string (sym, block, kind); std::string str = symbol_to_info_string (sym, block, kind);

View file

@ -42,7 +42,7 @@
/* Helper macro. */ /* Helper macro. */
#define target_debug_do_print(E) \ #define target_debug_do_print(E) \
fputs_unfiltered ((E), gdb_stdlog); gdb_puts ((E), gdb_stdlog);
#define target_debug_print_enum_target_object(X) \ #define target_debug_print_enum_target_object(X) \
target_debug_do_print (plongest (X)) target_debug_do_print (plongest (X))
@ -180,7 +180,7 @@
static void static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status) target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
{ {
fputs_unfiltered (status->to_string ().c_str (), gdb_stdlog); gdb_puts (status->to_string ().c_str (), gdb_stdlog);
} }
@ -195,13 +195,13 @@ target_debug_print_target_wait_flags (target_wait_flags options)
{ {
std::string str = target_options_to_string (options); std::string str = target_options_to_string (options);
fputs_unfiltered (str.c_str (), gdb_stdlog); gdb_puts (str.c_str (), gdb_stdlog);
} }
static void static void
target_debug_print_signals (gdb::array_view<const unsigned char> sigs) target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
{ {
fputs_unfiltered ("{", gdb_stdlog); gdb_puts ("{", gdb_stdlog);
for (size_t i = 0; i < sigs.size (); i++) for (size_t i = 0; i < sigs.size (); i++)
if (sigs[i] != 0) if (sigs[i] != 0)
@ -209,7 +209,7 @@ target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
fprintf_unfiltered (gdb_stdlog, " %s", fprintf_unfiltered (gdb_stdlog, " %s",
gdb_signal_to_name ((enum gdb_signal) i)); gdb_signal_to_name ((enum gdb_signal) i));
} }
fputs_unfiltered (" }", gdb_stdlog); gdb_puts (" }", gdb_stdlog);
} }
static void static void
@ -221,14 +221,14 @@ target_debug_print_size_t (size_t size)
static void static void
target_debug_print_const_gdb_byte_vector_r (const gdb::byte_vector &vector) target_debug_print_const_gdb_byte_vector_r (const gdb::byte_vector &vector)
{ {
fputs_unfiltered ("{", gdb_stdlog); gdb_puts ("{", gdb_stdlog);
for (size_t i = 0; i < vector.size (); i++) for (size_t i = 0; i < vector.size (); i++)
{ {
fprintf_unfiltered (gdb_stdlog, " %s", fprintf_unfiltered (gdb_stdlog, " %s",
phex_nz (vector[i], 1)); phex_nz (vector[i], 1));
} }
fputs_unfiltered (" }", gdb_stdlog); gdb_puts (" }", gdb_stdlog);
} }
static void static void

File diff suppressed because it is too large Load diff

View file

@ -1858,7 +1858,7 @@ maint_print_xml_tdesc_cmd (const char *args, int from_tty)
std::string buf; std::string buf;
print_xml_feature v (&buf); print_xml_feature v (&buf);
tdesc->accept (v); tdesc->accept (v);
puts_filtered (buf.c_str ()); gdb_puts (buf.c_str ());
} }
namespace selftests { namespace selftests {

View file

@ -1769,7 +1769,7 @@ target_xfer_partial (struct target_ops *ops,
{ {
int i; int i;
fputs_unfiltered (", bytes =", gdb_stdlog); gdb_puts (", bytes =", gdb_stdlog);
for (i = 0; i < *xfered_len; i++) for (i = 0; i < *xfered_len; i++)
{ {
if ((((intptr_t) &(myaddr[i])) & 0xf) == 0) if ((((intptr_t) &(myaddr[i])) & 0xf) == 0)

View file

@ -471,7 +471,7 @@ tui_layout_window::replace_window (const char *name, const char *new_window)
void void
tui_layout_window::specification (ui_file *output, int depth) tui_layout_window::specification (ui_file *output, int depth)
{ {
fputs_unfiltered (get_name (), output); gdb_puts (get_name (), output);
} }
/* See tui-layout.h. */ /* See tui-layout.h. */
@ -806,23 +806,23 @@ void
tui_layout_split::specification (ui_file *output, int depth) tui_layout_split::specification (ui_file *output, int depth)
{ {
if (depth > 0) if (depth > 0)
fputs_unfiltered ("{", output); gdb_puts ("{", output);
if (!m_vertical) if (!m_vertical)
fputs_unfiltered ("-horizontal ", output); gdb_puts ("-horizontal ", output);
bool first = true; bool first = true;
for (auto &item : m_splits) for (auto &item : m_splits)
{ {
if (!first) if (!first)
fputs_unfiltered (" ", output); gdb_puts (" ", output);
first = false; first = false;
item.layout->specification (output, depth + 1); item.layout->specification (output, depth + 1);
fprintf_unfiltered (output, " %d", item.weight); fprintf_unfiltered (output, " %d", item.weight);
} }
if (depth > 0) if (depth > 0)
fputs_unfiltered ("}", output); gdb_puts ("}", output);
} }
/* Destroy the layout associated with SELF. */ /* Destroy the layout associated with SELF. */

View file

@ -107,14 +107,14 @@ print_offset_data::maybe_print_hole (struct ui_file *stream,
{ {
fprintf_styled (stream, highlight_style.style (), fprintf_styled (stream, highlight_style.style (),
"/* XXX %2u-bit %-7s */", hole_bit, for_what); "/* XXX %2u-bit %-7s */", hole_bit, for_what);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
if (hole_byte > 0) if (hole_byte > 0)
{ {
fprintf_styled (stream, highlight_style.style (), fprintf_styled (stream, highlight_style.style (),
"/* XXX %2u-byte %-7s */", hole_byte, for_what); "/* XXX %2u-byte %-7s */", hole_byte, for_what);
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
} }
} }
} }
@ -187,7 +187,7 @@ print_offset_data::finish (struct type *type, int level,
unsigned int bitpos = TYPE_LENGTH (type) * TARGET_CHAR_BIT; unsigned int bitpos = TYPE_LENGTH (type) * TARGET_CHAR_BIT;
maybe_print_hole (stream, bitpos, "padding"); maybe_print_hole (stream, bitpos, "padding");
fputs_filtered ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (level + 4 + print_offset_data::indentation, stream); print_spaces_filtered (level + 4 + print_offset_data::indentation, stream);
fprintf_filtered (stream, "/* total size (bytes): %4s */\n", fprintf_filtered (stream, "/* total size (bytes): %4s */\n",
pulongest (TYPE_LENGTH (type))); pulongest (TYPE_LENGTH (type)));
@ -633,7 +633,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
} }
if (i < len) if (i < len)
{ {
fputs_filtered (type->field (i).name (), stream); gdb_puts (type->field (i).name (), stream);
} }
else else
{ {

View file

@ -150,7 +150,7 @@ vwarning (const char *string, va_list args)
gdb_stdout->wrap_here (0); /* Force out any buffered output. */ gdb_stdout->wrap_here (0); /* Force out any buffered output. */
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
if (warning_pre_print) if (warning_pre_print)
fputs_unfiltered (warning_pre_print, gdb_stderr); gdb_puts (warning_pre_print, gdb_stderr);
gdb_vprintf (gdb_stderr, string, args); gdb_vprintf (gdb_stderr, string, args);
fprintf_unfiltered (gdb_stderr, "\n"); fprintf_unfiltered (gdb_stderr, "\n");
} }
@ -180,7 +180,7 @@ abort_with_message (const char *msg)
if (current_ui == NULL) if (current_ui == NULL)
fputs (msg, stderr); fputs (msg, stderr);
else else
fputs_unfiltered (msg, gdb_stderr); gdb_puts (msg, gdb_stderr);
abort (); /* ARI: abort */ abort (); /* ARI: abort */
} }
@ -404,11 +404,11 @@ internal_vproblem (struct internal_problem *problem,
else else
internal_error (__FILE__, __LINE__, _("bad switch")); internal_error (__FILE__, __LINE__, _("bad switch"));
fputs_unfiltered (_("\nThis is a bug, please report it."), gdb_stderr); gdb_puts (_("\nThis is a bug, please report it."), gdb_stderr);
if (REPORT_BUGS_TO[0]) if (REPORT_BUGS_TO[0])
fprintf_unfiltered (gdb_stderr, _(" For instructions, see:\n%s."), fprintf_unfiltered (gdb_stderr, _(" For instructions, see:\n%s."),
REPORT_BUGS_TO); REPORT_BUGS_TO);
fputs_unfiltered ("\n\n", gdb_stderr); gdb_puts ("\n\n", gdb_stderr);
if (problem->should_dump_core == internal_problem_ask) if (problem->should_dump_core == internal_problem_ask)
{ {
@ -1156,7 +1156,7 @@ static bool pagination_disabled_for_command;
/* Buffer and start column of buffered text, for doing smarter word- /* Buffer and start column of buffered text, for doing smarter word-
wrapping. When someone calls wrap_here(), we start buffering output wrapping. When someone calls wrap_here(), we start buffering output
that comes through fputs_filtered(). If we see a newline, we just that comes through gdb_puts(). If we see a newline, we just
spit it out and forget about the wrap_here(). If we see another spit it out and forget about the wrap_here(). If we see another
wrap_here(), we spit it out and remember the newer one. If we see wrap_here(), we spit it out and remember the newer one. If we see
the end of the line, we spit out a newline, the indent, and then the end of the line, we spit out a newline, the indent, and then
@ -1521,13 +1521,13 @@ puts_filtered_tabular (char *string, int width, int right)
gdb_assert (chars_per_line > 0); gdb_assert (chars_per_line > 0);
if (chars_per_line == UINT_MAX) if (chars_per_line == UINT_MAX)
{ {
puts_filtered (string); gdb_puts (string);
puts_filtered ("\n"); gdb_puts ("\n");
return; return;
} }
if (((chars_printed - 1) / width + 2) * width >= chars_per_line) if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
puts_filtered ("\n"); gdb_puts ("\n");
if (width >= chars_per_line) if (width >= chars_per_line)
width = chars_per_line - 1; width = chars_per_line - 1;
@ -1544,8 +1544,8 @@ puts_filtered_tabular (char *string, int width, int right)
while (spaces--) while (spaces--)
spacebuf[spaces] = ' '; spacebuf[spaces] = ' ';
puts_filtered (spacebuf); gdb_puts (spacebuf);
puts_filtered (string); gdb_puts (string);
} }
@ -1559,7 +1559,7 @@ begin_line (void)
{ {
if (chars_printed > 0) if (chars_printed > 0)
{ {
puts_filtered ("\n"); gdb_puts ("\n");
} }
} }
@ -1734,13 +1734,7 @@ pager_file::write (const char *buf, long length_buf)
} }
void void
fputs_unfiltered (const char *linebuffer, struct ui_file *stream) gdb_puts (const char *linebuffer, struct ui_file *stream)
{
stream->puts_unfiltered (linebuffer);
}
void
fputs_filtered (const char *linebuffer, struct ui_file *stream)
{ {
stream->puts (linebuffer); stream->puts (linebuffer);
} }
@ -1752,7 +1746,7 @@ fputs_styled (const char *linebuffer, const ui_file_style &style,
struct ui_file *stream) struct ui_file *stream)
{ {
stream->emit_style_escape (style); stream->emit_style_escape (style);
fputs_filtered (linebuffer, stream); gdb_puts (linebuffer, stream);
stream->emit_style_escape (ui_file_style ()); stream->emit_style_escape (ui_file_style ());
} }
@ -1789,7 +1783,7 @@ fputs_highlighted (const char *str, const compiled_regex &highlight,
/* Output the trailing part of STR not matching HIGHLIGHT. */ /* Output the trailing part of STR not matching HIGHLIGHT. */
if (*str) if (*str)
fputs_filtered (str, stream); gdb_puts (str, stream);
} }
/* Write character C to gdb_stdout using GDB's paging mechanism and return C. /* Write character C to gdb_stdout using GDB's paging mechanism and return C.
@ -1808,7 +1802,7 @@ fputc_unfiltered (int c, struct ui_file *stream)
buf[0] = c; buf[0] = c;
buf[1] = 0; buf[1] = 0;
fputs_unfiltered (buf, stream); gdb_puts (buf, stream);
return c; return c;
} }
@ -1819,7 +1813,7 @@ fputc_filtered (int c, struct ui_file *stream)
buf[0] = c; buf[0] = c;
buf[1] = 0; buf[1] = 0;
fputs_filtered (buf, stream); gdb_puts (buf, stream);
return c; return c;
} }
@ -1910,9 +1904,9 @@ printf_unfiltered (const char *format, ...)
This one doesn't, and had better not! */ This one doesn't, and had better not! */
void void
puts_filtered (const char *string) gdb_puts (const char *string)
{ {
fputs_filtered (string, gdb_stdout); gdb_stdout->puts (string);
} }
/* Return a pointer to N spaces and a null. The pointer is good /* Return a pointer to N spaces and a null. The pointer is good
@ -1941,7 +1935,7 @@ n_spaces (int n)
void void
print_spaces_filtered (int n, struct ui_file *stream) print_spaces_filtered (int n, struct ui_file *stream)
{ {
fputs_filtered (n_spaces (n), stream); gdb_puts (n_spaces (n), stream);
} }
/* C++/ObjC demangler stuff. */ /* C++/ObjC demangler stuff. */
@ -1960,13 +1954,13 @@ fprintf_symbol_filtered (struct ui_file *stream, const char *name,
/* If user wants to see raw output, no problem. */ /* If user wants to see raw output, no problem. */
if (!demangle) if (!demangle)
{ {
fputs_filtered (name, stream); gdb_puts (name, stream);
} }
else else
{ {
gdb::unique_xmalloc_ptr<char> demangled gdb::unique_xmalloc_ptr<char> demangled
= language_demangle (language_def (lang), name, arg_mode); = language_demangle (language_def (lang), name, arg_mode);
fputs_filtered (demangled ? demangled.get () : name, stream); gdb_puts (demangled ? demangled.get () : name, stream);
} }
} }
} }

View file

@ -233,9 +233,7 @@ extern void set_screen_width_and_height (int width, int height);
here are the styling formatters: '%p[', '%p]' and '%ps'. See here are the styling formatters: '%p[', '%p]' and '%ps'. See
ui_out::message for details. */ ui_out::message for details. */
extern void fputs_filtered (const char *, struct ui_file *); extern void gdb_puts (const char *, struct ui_file *);
extern void fputs_unfiltered (const char *, struct ui_file *);
extern int fputc_filtered (int c, struct ui_file *); extern int fputc_filtered (int c, struct ui_file *);
@ -243,7 +241,7 @@ extern int fputc_unfiltered (int c, struct ui_file *);
extern int putchar_filtered (int c); extern int putchar_filtered (int c);
extern void puts_filtered (const char *); extern void gdb_puts (const char *);
extern void puts_filtered_tabular (char *string, int width, int right); extern void puts_filtered_tabular (char *string, int width, int right);
@ -284,7 +282,7 @@ extern void vfprintf_styled (struct ui_file *stream,
va_list args) va_list args)
ATTRIBUTE_PRINTF (3, 0); ATTRIBUTE_PRINTF (3, 0);
/* Like fputs_filtered, but styles the output according to STYLE, when /* Like gdb_puts, but styles the output according to STYLE, when
appropriate. */ appropriate. */
extern void fputs_styled (const char *linebuffer, extern void fputs_styled (const char *linebuffer,

View file

@ -435,7 +435,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
if (options->symbol_print) if (options->symbol_print)
print_address_demangle (options, gdbarch, address, stream, demangle); print_address_demangle (options, gdbarch, address, stream, demangle);
else if (options->addressprint) else if (options->addressprint)
fputs_filtered (paddress (gdbarch, address), stream); gdb_puts (paddress (gdbarch, address), stream);
} }
/* generic_val_print helper for TYPE_CODE_ARRAY. */ /* generic_val_print helper for TYPE_CODE_ARRAY. */
@ -458,9 +458,9 @@ generic_val_print_array (struct value *val,
if (!get_array_bounds (type, &low_bound, &high_bound)) if (!get_array_bounds (type, &low_bound, &high_bound))
error (_("Could not determine the array high bound")); error (_("Could not determine the array high bound"));
fputs_filtered (decorations->array_start, stream); gdb_puts (decorations->array_start, stream);
value_print_array_elements (val, stream, recurse, options, 0); value_print_array_elements (val, stream, recurse, options, 0);
fputs_filtered (decorations->array_end, stream); gdb_puts (decorations->array_end, stream);
} }
else else
{ {
@ -506,7 +506,7 @@ print_ref_address (struct type *type, const gdb_byte *address_buffer,
= extract_typed_address (address_buffer + embedded_offset, type); = extract_typed_address (address_buffer + embedded_offset, type);
fprintf_filtered (stream, "@"); fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, address), stream); gdb_puts (paddress (gdbarch, address), stream);
} }
/* Else: we have a non-addressable value, such as a DW_AT_const_value. */ /* Else: we have a non-addressable value, such as a DW_AT_const_value. */
} }
@ -581,7 +581,7 @@ generic_val_print_ref (struct type *type,
print_ref_address (type, address, embedded_offset, stream); print_ref_address (type, address, embedded_offset, stream);
if (options->deref_ref) if (options->deref_ref)
fputs_filtered (": ", stream); gdb_puts (": ", stream);
} }
if (options->deref_ref) if (options->deref_ref)
@ -590,7 +590,7 @@ generic_val_print_ref (struct type *type,
common_val_print (deref_val, stream, recurse, options, common_val_print (deref_val, stream, recurse, options,
current_language); current_language);
else else
fputs_filtered ("???", stream); gdb_puts ("???", stream);
} }
} }
@ -639,11 +639,11 @@ generic_val_print_enum_1 (struct type *type, LONGEST val,
{ {
if (first) if (first)
{ {
fputs_filtered ("(", stream); gdb_puts ("(", stream);
first = 0; first = 0;
} }
else else
fputs_filtered (" | ", stream); gdb_puts (" | ", stream);
val &= ~type->field (i).loc_enumval (); val &= ~type->field (i).loc_enumval ();
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
@ -655,24 +655,24 @@ generic_val_print_enum_1 (struct type *type, LONGEST val,
{ {
/* There are leftover bits, print them. */ /* There are leftover bits, print them. */
if (first) if (first)
fputs_filtered ("(", stream); gdb_puts ("(", stream);
else else
fputs_filtered (" | ", stream); gdb_puts (" | ", stream);
fputs_filtered ("unknown: 0x", stream); gdb_puts ("unknown: 0x", stream);
print_longest (stream, 'x', 0, val); print_longest (stream, 'x', 0, val);
fputs_filtered (")", stream); gdb_puts (")", stream);
} }
else if (first) else if (first)
{ {
/* Nothing has been printed and the value is 0, the enum value must /* Nothing has been printed and the value is 0, the enum value must
have been 0. */ have been 0. */
fputs_filtered ("0", stream); gdb_puts ("0", stream);
} }
else else
{ {
/* Something has been printed, close the parenthesis. */ /* Something has been printed, close the parenthesis. */
fputs_filtered (")", stream); gdb_puts (")", stream);
} }
} }
else else
@ -744,9 +744,9 @@ generic_value_print_bool
struct type *type = check_typedef (value_type (value)); struct type *type = check_typedef (value_type (value));
LONGEST val = unpack_long (type, valaddr); LONGEST val = unpack_long (type, valaddr);
if (val == 0) if (val == 0)
fputs_filtered (decorations->false_name, stream); gdb_puts (decorations->false_name, stream);
else if (val == 1) else if (val == 1)
fputs_filtered (decorations->true_name, stream); gdb_puts (decorations->true_name, stream);
else else
print_longest (stream, 'd', 0, val); print_longest (stream, 'd', 0, val);
} }
@ -790,7 +790,7 @@ generic_value_print_char (struct value *value, struct ui_file *stream,
fprintf_filtered (stream, "%u", (unsigned int) val); fprintf_filtered (stream, "%u", (unsigned int) val);
else else
fprintf_filtered (stream, "%d", (int) val); fprintf_filtered (stream, "%d", (int) val);
fputs_filtered (" ", stream); gdb_puts (" ", stream);
current_language->printchar (val, unresolved_type, stream); current_language->printchar (val, unresolved_type, stream);
} }
} }
@ -965,7 +965,7 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse,
break; break;
case TYPE_CODE_VOID: case TYPE_CODE_VOID:
fputs_filtered (decorations->void_name, stream); gdb_puts (decorations->void_name, stream);
break; break;
case TYPE_CODE_ERROR: case TYPE_CODE_ERROR:
@ -1081,7 +1081,7 @@ val_print_check_max_depth (struct ui_file *stream, int recurse,
if (options->max_depth > -1 && recurse >= options->max_depth) if (options->max_depth > -1 && recurse >= options->max_depth)
{ {
gdb_assert (language->struct_too_deep_ellipsis () != NULL); gdb_assert (language->struct_too_deep_ellipsis () != NULL);
fputs_filtered (language->struct_too_deep_ellipsis (), stream); gdb_puts (language->struct_too_deep_ellipsis (), stream);
return true; return true;
} }
@ -1193,7 +1193,7 @@ val_print_type_code_flags (struct type *type, struct value *original_value,
struct gdbarch *gdbarch = type->arch (); struct gdbarch *gdbarch = type->arch ();
struct type *bool_type = builtin_type (gdbarch)->builtin_bool; struct type *bool_type = builtin_type (gdbarch)->builtin_bool;
fputs_filtered ("[", stream); gdb_puts ("[", stream);
for (field = 0; field < nfields; field++) for (field = 0; field < nfields; field++)
{ {
if (type->field (field).name ()[0] != '\0') if (type->field (field).name ()[0] != '\0')
@ -1230,7 +1230,7 @@ val_print_type_code_flags (struct type *type, struct value *original_value,
} }
} }
} }
fputs_filtered (" ]", stream); gdb_puts (" ]", stream);
} }
/* See valprint.h. */ /* See valprint.h. */
@ -1321,7 +1321,7 @@ print_longest (struct ui_file *stream, int format, int use_c_format,
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("failed internal consistency check")); _("failed internal consistency check"));
} }
fputs_filtered (val, stream); gdb_puts (val, stream);
} }
/* This used to be a macro, but I don't think it is called often enough /* This used to be a macro, but I don't think it is called often enough
@ -1355,7 +1355,7 @@ print_floating (const gdb_byte *valaddr, struct type *type,
struct ui_file *stream) struct ui_file *stream)
{ {
std::string str = target_float_to_string (valaddr, type); std::string str = target_float_to_string (valaddr, type);
fputs_filtered (str.c_str (), stream); gdb_puts (str.c_str (), stream);
} }
void void
@ -1484,7 +1484,7 @@ print_octal_chars (struct ui_file *stream, const gdb_byte *valaddr,
cycle = (len * HOST_CHAR_BIT) % BITS_IN_OCTAL; cycle = (len * HOST_CHAR_BIT) % BITS_IN_OCTAL;
carry = 0; carry = 0;
fputs_filtered ("0", stream); gdb_puts ("0", stream);
bool seen_a_one = false; bool seen_a_one = false;
if (byte_order == BFD_ENDIAN_BIG) if (byte_order == BFD_ENDIAN_BIG)
{ {
@ -1661,7 +1661,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr,
if (is_signed if (is_signed
&& maybe_negate_by_bytes (valaddr, len, byte_order, &negated_bytes)) && maybe_negate_by_bytes (valaddr, len, byte_order, &negated_bytes))
{ {
fputs_filtered ("-", stream); gdb_puts ("-", stream);
valaddr = negated_bytes.data (); valaddr = negated_bytes.data ();
} }
@ -1781,7 +1781,7 @@ print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
{ {
const gdb_byte *p; const gdb_byte *p;
fputs_filtered ("0x", stream); gdb_puts ("0x", stream);
if (byte_order == BFD_ENDIAN_BIG) if (byte_order == BFD_ENDIAN_BIG)
{ {
p = valaddr; p = valaddr;
@ -1850,9 +1850,9 @@ print_function_pointer_address (const struct value_print_options *options,
the address of the description. */ the address of the description. */
if (options->addressprint && func_addr != address) if (options->addressprint && func_addr != address)
{ {
fputs_filtered ("@", stream); gdb_puts ("@", stream);
fputs_filtered (paddress (gdbarch, address), stream); gdb_puts (paddress (gdbarch, address), stream);
fputs_filtered (": ", stream); gdb_puts (": ", stream);
} }
print_address_demangle (options, gdbarch, func_addr, stream, demangle); print_address_demangle (options, gdbarch, func_addr, stream, demangle);
} }
@ -2353,7 +2353,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream,
sizeof (gdb_wchar_t), &output, translit_char); sizeof (gdb_wchar_t), &output, translit_char);
obstack_1grow (&output, '\0'); obstack_1grow (&output, '\0');
fputs_filtered ((const char *) obstack_base (&output), stream); gdb_puts ((const char *) obstack_base (&output), stream);
} }
/* Return the repeat count of the next character/byte in ITER, /* Return the repeat count of the next character/byte in ITER,
@ -2639,7 +2639,7 @@ generic_printstr (struct ui_file *stream, struct type *type,
if (length == 0) if (length == 0)
{ {
fputs_filtered ("\"\"", stream); gdb_puts ("\"\"", stream);
return; return;
} }
@ -2696,7 +2696,7 @@ generic_printstr (struct ui_file *stream, struct type *type,
sizeof (gdb_wchar_t), &output, translit_char); sizeof (gdb_wchar_t), &output, translit_char);
obstack_1grow (&output, '\0'); obstack_1grow (&output, '\0');
fputs_filtered ((const char *) obstack_base (&output), stream); gdb_puts ((const char *) obstack_base (&output), stream);
} }
/* Print a string from the inferior, starting at ADDR and printing up to LEN /* Print a string from the inferior, starting at ADDR and printing up to LEN

View file

@ -944,7 +944,7 @@ display_selector (HANDLE thread, DWORD sel)
printf_filtered ("0x%03x: ", (unsigned) sel); printf_filtered ("0x%03x: ", (unsigned) sel);
if (!info.HighWord.Bits.Pres) if (!info.HighWord.Bits.Pres)
{ {
puts_filtered ("Segment not present\n"); gdb_puts ("Segment not present\n");
return 0; return 0;
} }
base = (info.HighWord.Bits.BaseHi << 24) + base = (info.HighWord.Bits.BaseHi << 24) +
@ -955,50 +955,50 @@ display_selector (HANDLE thread, DWORD sel)
limit = (limit << 12) | 0xfff; limit = (limit << 12) | 0xfff;
printf_filtered ("base=0x%08x limit=0x%08x", base, limit); printf_filtered ("base=0x%08x limit=0x%08x", base, limit);
if (info.HighWord.Bits.Default_Big) if (info.HighWord.Bits.Default_Big)
puts_filtered(" 32-bit "); gdb_puts(" 32-bit ");
else else
puts_filtered(" 16-bit "); gdb_puts(" 16-bit ");
switch ((info.HighWord.Bits.Type & 0xf) >> 1) switch ((info.HighWord.Bits.Type & 0xf) >> 1)
{ {
case 0: case 0:
puts_filtered ("Data (Read-Only, Exp-up"); gdb_puts ("Data (Read-Only, Exp-up");
break; break;
case 1: case 1:
puts_filtered ("Data (Read/Write, Exp-up"); gdb_puts ("Data (Read/Write, Exp-up");
break; break;
case 2: case 2:
puts_filtered ("Unused segment ("); gdb_puts ("Unused segment (");
break; break;
case 3: case 3:
puts_filtered ("Data (Read/Write, Exp-down"); gdb_puts ("Data (Read/Write, Exp-down");
break; break;
case 4: case 4:
puts_filtered ("Code (Exec-Only, N.Conf"); gdb_puts ("Code (Exec-Only, N.Conf");
break; break;
case 5: case 5:
puts_filtered ("Code (Exec/Read, N.Conf"); gdb_puts ("Code (Exec/Read, N.Conf");
break; break;
case 6: case 6:
puts_filtered ("Code (Exec-Only, Conf"); gdb_puts ("Code (Exec-Only, Conf");
break; break;
case 7: case 7:
puts_filtered ("Code (Exec/Read, Conf"); gdb_puts ("Code (Exec/Read, Conf");
break; break;
default: default:
printf_filtered ("Unknown type 0x%lx", printf_filtered ("Unknown type 0x%lx",
(unsigned long) info.HighWord.Bits.Type); (unsigned long) info.HighWord.Bits.Type);
} }
if ((info.HighWord.Bits.Type & 0x1) == 0) if ((info.HighWord.Bits.Type & 0x1) == 0)
puts_filtered(", N.Acc"); gdb_puts(", N.Acc");
puts_filtered (")\n"); gdb_puts (")\n");
if ((info.HighWord.Bits.Type & 0x10) == 0) if ((info.HighWord.Bits.Type & 0x10) == 0)
puts_filtered("System selector "); gdb_puts("System selector ");
printf_filtered ("Priviledge level = %ld. ", printf_filtered ("Priviledge level = %ld. ",
(unsigned long) info.HighWord.Bits.Dpl); (unsigned long) info.HighWord.Bits.Dpl);
if (info.HighWord.Bits.Granularity) if (info.HighWord.Bits.Granularity)
puts_filtered ("Page granular.\n"); gdb_puts ("Page granular.\n");
else else
puts_filtered ("Byte granular.\n"); gdb_puts ("Byte granular.\n");
return 1; return 1;
} }
else else
@ -1017,7 +1017,7 @@ display_selectors (const char * args, int from_tty)
{ {
if (inferior_ptid == null_ptid) if (inferior_ptid == null_ptid)
{ {
puts_filtered ("Impossible to display selectors now.\n"); gdb_puts ("Impossible to display selectors now.\n");
return; return;
} }
@ -1029,44 +1029,44 @@ display_selectors (const char * args, int from_tty)
#ifdef __x86_64__ #ifdef __x86_64__
if (wow64_process) if (wow64_process)
{ {
puts_filtered ("Selector $cs\n"); gdb_puts ("Selector $cs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegCs); current_windows_thread->wow64_context.SegCs);
puts_filtered ("Selector $ds\n"); gdb_puts ("Selector $ds\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegDs); current_windows_thread->wow64_context.SegDs);
puts_filtered ("Selector $es\n"); gdb_puts ("Selector $es\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegEs); current_windows_thread->wow64_context.SegEs);
puts_filtered ("Selector $ss\n"); gdb_puts ("Selector $ss\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegSs); current_windows_thread->wow64_context.SegSs);
puts_filtered ("Selector $fs\n"); gdb_puts ("Selector $fs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegFs); current_windows_thread->wow64_context.SegFs);
puts_filtered ("Selector $gs\n"); gdb_puts ("Selector $gs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->wow64_context.SegGs); current_windows_thread->wow64_context.SegGs);
} }
else else
#endif #endif
{ {
puts_filtered ("Selector $cs\n"); gdb_puts ("Selector $cs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegCs); current_windows_thread->context.SegCs);
puts_filtered ("Selector $ds\n"); gdb_puts ("Selector $ds\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegDs); current_windows_thread->context.SegDs);
puts_filtered ("Selector $es\n"); gdb_puts ("Selector $es\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegEs); current_windows_thread->context.SegEs);
puts_filtered ("Selector $ss\n"); gdb_puts ("Selector $ss\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegSs); current_windows_thread->context.SegSs);
puts_filtered ("Selector $fs\n"); gdb_puts ("Selector $fs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegFs); current_windows_thread->context.SegFs);
puts_filtered ("Selector $gs\n"); gdb_puts ("Selector $gs\n");
display_selector (current_windows_thread->h, display_selector (current_windows_thread->h,
current_windows_thread->context.SegGs); current_windows_thread->context.SegGs);
} }