Unify gdb printf functions

Now that filtered and unfiltered output can be treated identically, we
can unify the printf family of functions.  This is done under the name
"gdb_printf".  Most of this patch was written by script.
This commit is contained in:
Tom Tromey
2022-01-02 11:46:15 -07:00
parent a11ac3b3e8
commit 6cb06a8cda
249 changed files with 8449 additions and 8463 deletions

View File

@ -380,7 +380,7 @@ static void
maybe_say_no_core_file_now (int from_tty)
{
if (from_tty)
printf_filtered (_("No core file now.\n"));
gdb_printf (_("No core file now.\n"));
}
/* Backward compatibility with old way of specifying core files. */
@ -571,7 +571,7 @@ core_target_open (const char *arg, int from_tty)
p = bfd_core_file_failing_command (core_bfd);
if (p)
printf_filtered (_("Core was generated by `%s'.\n"), p);
gdb_printf (_("Core was generated by `%s'.\n"), p);
/* Clearing any previous state of convenience variables. */
clear_exit_convenience_vars ();
@ -593,11 +593,11 @@ core_target_open (const char *arg, int from_tty)
siggy)
: gdb_signal_from_host (siggy));
printf_filtered (_("Program terminated with signal %s, %s"),
gdb_signal_to_name (sig), gdb_signal_to_string (sig));
gdb_printf (_("Program terminated with signal %s, %s"),
gdb_signal_to_name (sig), gdb_signal_to_string (sig));
if (gdbarch_report_signal_info_p (core_gdbarch))
gdbarch_report_signal_info (core_gdbarch, current_uiout, sig);
printf_filtered (_(".\n"));
gdb_printf (_(".\n"));
/* Set the value of the internal variable $_exitsignal,
which holds the signal uncaught by the inferior. */
@ -760,8 +760,8 @@ core_target::fetch_registers (struct regcache *regcache, int regno)
if (!(m_core_gdbarch != nullptr
&& gdbarch_iterate_over_regset_sections_p (m_core_gdbarch)))
{
fprintf_filtered (gdb_stderr,
"Can't fetch registers from this type of core file\n");
gdb_printf (gdb_stderr,
"Can't fetch registers from this type of core file\n");
return;
}
@ -1179,20 +1179,20 @@ core_target::info_proc_mappings (struct gdbarch *gdbarch)
{
if (!m_core_file_mappings.empty ())
{
printf_filtered (_("Mapped address spaces:\n\n"));
gdb_printf (_("Mapped address spaces:\n\n"));
if (gdbarch_addr_bit (gdbarch) == 32)
{
printf_filtered ("\t%10s %10s %10s %10s %s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
gdb_printf ("\t%10s %10s %10s %10s %s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
}
else
{
printf_filtered (" %18s %18s %10s %10s %s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
gdb_printf (" %18s %18s %10s %10s %s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
}
}
@ -1204,19 +1204,19 @@ core_target::info_proc_mappings (struct gdbarch *gdbarch)
const char *filename = bfd_get_filename (tsp.the_bfd_section->owner);
if (gdbarch_addr_bit (gdbarch) == 32)
printf_filtered ("\t%10s %10s %10s %10s %s\n",
paddress (gdbarch, start),
paddress (gdbarch, end),
hex_string (end - start),
hex_string (file_ofs),
filename);
gdb_printf ("\t%10s %10s %10s %10s %s\n",
paddress (gdbarch, start),
paddress (gdbarch, end),
hex_string (end - start),
hex_string (file_ofs),
filename);
else
printf_filtered (" %18s %18s %10s %10s %s\n",
paddress (gdbarch, start),
paddress (gdbarch, end),
hex_string (end - start),
hex_string (file_ofs),
filename);
gdb_printf (" %18s %18s %10s %10s %s\n",
paddress (gdbarch, start),
paddress (gdbarch, end),
hex_string (end - start),
hex_string (file_ofs),
filename);
}
}