bl->loc_type = new_type;
if (!said)
{
- fprintf_filtered (gdb_stdout,
- _("Note: automatically using "
- "hardware breakpoints for "
- "read-only addresses.\n"));
+ printf_filtered (_("Note: automatically using "
+ "hardware breakpoints for "
+ "read-only addresses.\n"));
said = true;
}
}
/* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from
the user is not accounted for. */
- fprintf_unfiltered (gdb_stdout, "%s", actual_gdb_prompt.c_str ());
+ printf_unfiltered ("%s", actual_gdb_prompt.c_str ());
gdb_flush (gdb_stdout);
}
}
size = kve->kve_end - kve->kve_start;
if (info_verbose)
{
- fprintf_filtered (gdb_stdout,
- "Save segment, %ld bytes at %s (%c%c%c)\n",
- (long) size,
- paddress (target_gdbarch (), kve->kve_start),
- kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
- kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
- kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
+ printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
+ (long) size,
+ paddress (target_gdbarch (), kve->kve_start),
+ kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
+ kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
+ kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
}
/* Invoke the callback function to create the corefile segment.
}
if (info_verbose)
- fprintf_filtered (gdb_stdout,
- "Opening corefile '%s' for output.\n",
- corefilename.get ());
+ printf_filtered ("Opening corefile '%s' for output.\n",
+ corefilename.get ());
if (target_supports_dumpcore ())
target_dumpcore (corefilename.get ());
unlink_file.keep ();
}
- fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename.get ());
+ printf_filtered ("Saved corefile %s\n", corefilename.get ());
}
static enum bfd_architecture
{
if (info_verbose)
{
- fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
- plongest (size), paddress (target_gdbarch (), vaddr));
+ printf_filtered ("Ignore segment, %s bytes at %s\n",
+ plongest (size), paddress (target_gdbarch (), vaddr));
}
return 0;
if (info_verbose)
{
- fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
- plongest (size), paddress (target_gdbarch (), vaddr));
+ printf_filtered ("Save segment, %s bytes at %s\n",
+ plongest (size), paddress (target_gdbarch (), vaddr));
}
bfd_set_section_size (osec, size);
/* GDB is usually silent when a parameter is set. */
if (*msg.get () != '\0')
- fprintf_filtered (gdb_stdout, "%s\n", msg.get ());
+ printf_filtered ("%s\n", msg.get ());
}
/* A callback function that is registered against the respective
if (from_tty)
{
printf_filtered (_("Continuing at "));
- fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
+ puts_filtered (paddress (gdbarch, addr));
printf_filtered (".\n");
}
if (fi.num == 0)
printf_filtered (_(" (main process)"));
printf_filtered (_(" at "));
- fputs_filtered (paddress (gdbarch, pc), gdb_stdout);
+ puts_filtered (paddress (gdbarch, pc));
symtab_and_line sal = find_pc_line (pc, 0);
if (sal.symtab)
if (length == 0)
{
- fputs_filtered ("\"\"", gdb_stdout);
+ puts_filtered ("\"\"");
return;
}
{
gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
- fputs_filtered ("expands to: ", gdb_stdout);
- fputs_filtered (expanded.get (), gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ puts_filtered ("expands to: ");
+ puts_filtered (expanded.get ());
+ puts_filtered ("\n");
}
else
macro_inform_no_debuginfo ();
{
gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
- fputs_filtered ("expands to: ", gdb_stdout);
- fputs_filtered (expanded.get (), gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ puts_filtered ("expands to: ");
+ puts_filtered (expanded.get ());
+ puts_filtered ("\n");
}
else
macro_inform_no_debuginfo ();
struct macro_source_file *file,
int line)
{
- fprintf_filtered (gdb_stdout, "Defined at ");
+ printf_filtered ("Defined at ");
show_pp_source_pos (gdb_stdout, file, line);
if (line != 0)
- fprintf_filtered (gdb_stdout, "#define %s", name);
+ printf_filtered ("#define %s", name);
else
- fprintf_filtered (gdb_stdout, "-D%s", name);
+ printf_filtered ("-D%s", name);
if (d->kind == macro_function_like)
{
int i;
- fputs_filtered ("(", gdb_stdout);
+ puts_filtered ("(");
for (i = 0; i < d->argc; i++)
{
- fputs_filtered (d->argv[i], gdb_stdout);
+ puts_filtered (d->argv[i]);
if (i + 1 < d->argc)
- fputs_filtered (", ", gdb_stdout);
+ puts_filtered (", ");
}
- fputs_filtered (")", gdb_stdout);
+ puts_filtered (")");
}
if (line != 0)
- fprintf_filtered (gdb_stdout, " %s\n", d->replacement);
+ printf_filtered (" %s\n", d->replacement);
else
- fprintf_filtered (gdb_stdout, "=%s\n", d->replacement);
+ printf_filtered ("=%s\n", d->replacement);
}
/* The implementation of the `info macro' command. */
}
else
{
- fprintf_filtered (gdb_stdout,
- "The symbol `%s' has no definition as a C/C++"
- " preprocessor macro\n"
- "at ", name);
+ printf_filtered ("The symbol `%s' has no definition as a C/C++"
+ " preprocessor macro\n"
+ "at ", name);
show_pp_source_pos (gdb_stdout, ms->file, ms->line);
}
}
print_one_macro (const char *name, const struct macro_definition *macro,
struct macro_source_file *source, int line)
{
- fprintf_filtered (gdb_stdout, "macro define %s", name);
+ printf_filtered ("macro define %s", name);
if (macro->kind == macro_function_like)
{
int i;
- fprintf_filtered (gdb_stdout, "(");
+ printf_filtered ("(");
for (i = 0; i < macro->argc; ++i)
- fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "",
- macro->argv[i]);
- fprintf_filtered (gdb_stdout, ")");
+ printf_filtered ("%s%s", (i > 0) ? ", " : "",
+ macro->argv[i]);
+ printf_filtered (")");
}
- fprintf_filtered (gdb_stdout, " %s\n", macro->replacement);
+ printf_filtered (" %s\n", macro->replacement);
}
size_t size = kve->kve_end - kve->kve_start;
if (info_verbose)
{
- fprintf_filtered (gdb_stdout,
- "Save segment, %ld bytes at %s (%c%c%c)\n",
- (long) size,
- paddress (target_gdbarch (), kve->kve_start),
- kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
- kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
- kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
+ printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
+ (long) size,
+ paddress (target_gdbarch (), kve->kve_start),
+ kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
+ kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
+ kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
}
/* Invoke the callback function to create the corefile segment.
}
if (format == 'i')
- fputs_filtered (pc_prefix (next_address), gdb_stdout);
+ puts_filtered (pc_prefix (next_address));
print_address (next_gdbarch, next_address, gdb_stdout);
printf_filtered (":");
for (i = maxelts;
}
printf_filtered ("Symbol \"");
- fputs_filtered (sym->print_name (), gdb_stdout);
+ puts_filtered (sym->print_name ());
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
if (SYMBOL_OBJFILE_OWNED (sym))
}
catch (const gdb_exception_error &ex)
{
- fprintf_filtered (gdb_stdout, _("%p[<error: %s>%p]\n"),
- metadata_style.style ().ptr (), ex.what (),
- nullptr);
+ printf_filtered (_("%p[<error: %s>%p]\n"),
+ metadata_style.style ().ptr (), ex.what (),
+ nullptr);
}
}
else
/* Inform about additional files to be read in. */
if (info_verbose)
{
- fputs_filtered (" ", gdb_stdout);
+ puts_filtered (" ");
wrap_here ("");
- fputs_filtered ("and ", gdb_stdout);
+ puts_filtered ("and ");
wrap_here ("");
printf_filtered ("%s...", dependencies[i]->filename);
wrap_here (""); /* Flush output */
psymtab->fullname
? psymtab->fullname : "(null)");
printf_filtered (" text addresses ");
- fputs_filtered (paddress (gdbarch,
- psymtab->text_low (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch,
+ psymtab->text_low (objfile)));
printf_filtered (" -- ");
- fputs_filtered (paddress (gdbarch,
- psymtab->text_high (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch,
+ psymtab->text_high (objfile)));
printf_filtered ("\n");
printf_filtered (" psymtabs_addrmap_supported %s\n",
(psymtab->psymtabs_addrmap_supported
printf_filtered ("Psymtab ");
puts_filtered (ps->filename);
printf_filtered (" covers bad range ");
- fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
printf_filtered (" - ");
- fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
printf_filtered ("\n");
continue;
}
printf_filtered ("Psymtab ");
puts_filtered (ps->filename);
printf_filtered (" covers ");
- fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
printf_filtered (" - ");
- fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
printf_filtered (" but symtab covers only ");
- fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, BLOCK_START (b)));
printf_filtered (" - ");
- fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, BLOCK_END (b)));
printf_filtered ("\n");
}
}
const char *str = set_doc_string.get ();
if (str != nullptr && str[0] != '\0')
- fprintf_filtered (gdb_stdout, "%s\n", str);
+ printf_filtered ("%s\n", str);
}
/* A callback function that is registered against the respective
{
printf_filtered (_("Stack frame at "));
}
- fputs_filtered (paddress (gdbarch, get_frame_base (fi)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (fi)));
printf_filtered (":\n");
printf_filtered (" %s = ", pc_regname);
if (frame_pc_p)
- fputs_filtered (paddress (gdbarch, get_frame_pc (fi)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_pc (fi)));
else
fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout);
if (funname)
{
printf_filtered (" in ");
- fputs_filtered (funname, gdb_stdout);
+ puts_filtered (funname);
}
wrap_here (" ");
if (sal.symtab)
}
if (caller_pc_p)
- fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);
+ puts_filtered (paddress (gdbarch, caller_pc));
printf_filtered ("\n");
if (calling_frame_info == NULL)
else
{
printf_filtered (" called by frame at ");
- fputs_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)));
}
if (get_next_frame (fi) && calling_frame_info)
puts_filtered (",");
if (get_next_frame (fi))
{
printf_filtered (" caller of frame at ");
- fputs_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))));
}
if (get_next_frame (fi) || calling_frame_info)
puts_filtered ("\n");
else
{
printf_filtered (" Arglist at ");
- fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+ puts_filtered (paddress (gdbarch, arg_list));
printf_filtered (",");
if (!gdbarch_frame_num_args_p (gdbarch))
else
{
printf_filtered (" Locals at ");
- fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+ puts_filtered (paddress (gdbarch, arg_list));
printf_filtered (",");
}
}
(value_contents_all (value).data (), sp_size, byte_order);
printf_filtered (" Previous frame's sp is ");
- fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
+ puts_filtered (paddress (gdbarch, sp));
printf_filtered ("\n");
}
else if (VALUE_LVAL (value) == lval_memory)
{
printf_filtered (" Previous frame's sp at ");
- fputs_filtered (paddress (gdbarch, value_address (value)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, value_address (value)));
printf_filtered ("\n");
}
else if (VALUE_LVAL (value) == lval_register)
wrap_here (" ");
printf_filtered (" %s at ",
gdbarch_register_name (gdbarch, i));
- fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
+ puts_filtered (paddress (gdbarch, addr));
count++;
}
}
name = bfd_section_name (osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name);
- fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
+ puts_filtered (paddress (gdbarch, lma));
puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
+ puts_filtered (paddress (gdbarch, lma + size));
printf_filtered (", mapped at ");
- fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
+ puts_filtered (paddress (gdbarch, vma));
puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
+ puts_filtered (paddress (gdbarch, vma + size));
puts_filtered ("\n");
nmapped++;
/* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from
the user is not accounted for. */
- fputs_unfiltered (prompt, gdb_stdout);
+ puts_unfiltered (prompt);
gdb_flush (gdb_stdout);
}
printf_filtered ("constant bytes: ");
if (SYMBOL_TYPE (sym))
for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
- fprintf_filtered (gdb_stdout, " %02x",
- (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
+ printf_filtered (" %02x",
+ (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
break;
case LOC_STATIC:
printf_filtered ("in static storage at address ");
if (flags.print_offsets
&& (type->code () == TYPE_CODE_STRUCT
|| type->code () == TYPE_CODE_UNION))
- fprintf_filtered (gdb_stdout, "/* offset | size */ ");
+ printf_filtered ("/* offset | size */ ");
printf_filtered ("type = ");
static void
broken_doc_invariant (const char *prefix, const char *name, const char *msg)
{
- fprintf_filtered (gdb_stdout,
- "help doc broken invariant: command '%s%s' help doc %s\n",
- prefix, name, msg);
+ printf_filtered ("help doc broken invariant: command '%s%s' help doc %s\n",
+ prefix, name, msg);
nr_failed_invariants++;
}
auto dupl = lists.find (list);
if (dupl != lists.end ())
{
- fprintf_filtered (gdb_stdout,
- "list %p duplicated,"
- " reachable via prefix '%s' and '%s'."
- " Duplicated list first command is '%s'\n",
- list,
- prefix, dupl->second,
- (*list)->name);
+ printf_filtered ("list %p duplicated,"
+ " reachable via prefix '%s' and '%s'."
+ " Duplicated list first command is '%s'\n",
+ list,
+ prefix, dupl->second,
+ (*list)->name);
nr_duplicates++;
return;
}
|| (prefixcmd == nullptr && *list != cmdlist))
{
if (c->prefix == nullptr)
- fprintf_filtered (gdb_stdout,
- "list %p reachable via prefix '%s'."
- " command '%s' has null prefixcmd\n",
- list,
- prefix, c->name);
+ printf_filtered ("list %p reachable via prefix '%s'."
+ " command '%s' has null prefixcmd\n",
+ list,
+ prefix, c->name);
else
- fprintf_filtered (gdb_stdout,
- "list %p reachable via prefix '%s'."
- " command '%s' has a different prefixcmd\n",
- list,
- prefix, c->name);
+ printf_filtered ("list %p reachable via prefix '%s'."
+ " command '%s' has a different prefixcmd\n",
+ list,
+ prefix, c->name);
nr_invalid_prefixcmd++;
}
}
gdb_assert (chars_per_line > 0);
if (chars_per_line == UINT_MAX)
{
- fputs_filtered (string, gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ puts_filtered (string);
+ puts_filtered ("\n");
return;
}
if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
- fputs_filtered ("\n", gdb_stdout);
+ puts_filtered ("\n");
if (width >= chars_per_line)
width = chars_per_line - 1;
while (spaces--)
spacebuf[spaces] = ' ';
- fputs_filtered (spacebuf, gdb_stdout);
- fputs_filtered (string, gdb_stdout);
+ puts_filtered (spacebuf);
+ puts_filtered (string);
}