public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Unify gdb printf functions
@ 2022-03-29 19:43 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-03-29 19:43 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a
commit 6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a
Author: Tom Tromey <tom@tromey.com>
Date: Sun Jan 2 11:46:15 2022 -0700
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.
Diff:
---
gdb/aarch64-linux-tdep.c | 8 +-
gdb/aarch64-tdep.c | 16 +-
gdb/ada-lang.c | 88 +--
gdb/ada-tasks.c | 48 +-
gdb/ada-typeprint.c | 152 ++--
gdb/ada-valprint.c | 84 +--
gdb/addrmap.c | 8 +-
gdb/agent.c | 6 +-
gdb/aix-thread.c | 98 +--
gdb/alpha-tdep.c | 2 +-
gdb/amd64-linux-tdep.c | 8 +-
gdb/annotate.c | 2 +-
gdb/arc-tdep.c | 26 +-
gdb/arc-tdep.h | 2 +-
gdb/arch-utils.c | 128 ++--
gdb/arm-linux-tdep.c | 8 +-
gdb/arm-tdep.c | 152 ++--
gdb/auto-load.c | 50 +-
gdb/auxv.c | 12 +-
gdb/avr-tdep.c | 24 +-
gdb/ax-general.c | 22 +-
gdb/bcache.c | 82 +--
gdb/bcache.h | 2 +-
gdb/bpf-tdep.c | 12 +-
gdb/break-catch-exec.c | 4 +-
gdb/break-catch-fork.c | 8 +-
gdb/break-catch-sig.c | 20 +-
gdb/break-catch-syscall.c | 20 +-
gdb/break-catch-throw.c | 8 +-
gdb/breakpoint.c | 388 +++++------
gdb/bsd-kvm.c | 6 +-
gdb/btrace.c | 132 ++--
gdb/build-id.c | 18 +-
gdb/c-typeprint.c | 242 +++----
gdb/c-valprint.c | 32 +-
gdb/charset.c | 32 +-
gdb/cli-out.c | 20 +-
gdb/cli/cli-cmds.c | 124 ++--
gdb/cli/cli-decode.c | 78 +--
gdb/cli/cli-dump.c | 36 +-
gdb/cli/cli-logging.c | 45 +-
gdb/cli/cli-script.c | 8 +-
gdb/cli/cli-setshow.c | 4 +-
gdb/cli/cli-style.c | 14 +-
gdb/cli/cli-utils.c | 6 +-
gdb/coff-pe-read.c | 56 +-
gdb/compile/compile-c-support.c | 50 +-
gdb/compile/compile-c-symbols.c | 38 +-
gdb/compile/compile-cplus-symbols.c | 58 +-
gdb/compile/compile-cplus-types.c | 26 +-
gdb/compile/compile-loc2c.c | 118 ++--
gdb/compile/compile-object-load.c | 76 +-
gdb/compile/compile.c | 28 +-
gdb/complaints.c | 6 +-
gdb/copying.awk | 6 +-
gdb/copying.c | 1240 ++++++++++++++++-----------------
gdb/corefile.c | 4 +-
gdb/corelow.c | 56 +-
gdb/cp-namespace.c | 92 +--
gdb/cp-support.c | 8 +-
gdb/cp-valprint.c | 18 +-
gdb/cris-tdep.c | 14 +-
gdb/csky-tdep.c | 308 ++++----
gdb/ctfread.c | 6 +-
gdb/darwin-nat-info.c | 158 ++---
gdb/darwin-nat.c | 60 +-
gdb/dbxread.c | 12 +-
gdb/dcache.c | 38 +-
gdb/debuginfod-support.c | 66 +-
gdb/disasm-selftests.c | 6 +-
gdb/disasm.c | 44 +-
gdb/displaced-stepping.c | 2 +-
gdb/dummy-frame.c | 8 +-
gdb/dwarf2/frame.c | 6 +-
gdb/dwarf2/index-cache.c | 16 +-
| 8 +-
gdb/dwarf2/loc.c | 230 +++---
gdb/dwarf2/read.c | 204 +++---
gdb/elfread.c | 12 +-
gdb/event-top.c | 6 +-
gdb/exceptions.c | 2 +-
gdb/exec.c | 42 +-
gdb/expop.h | 2 +-
gdb/expprint.c | 42 +-
gdb/f-lang.c | 12 +-
gdb/f-typeprint.c | 54 +-
gdb/f-valprint.c | 36 +-
gdb/fbsd-nat.c | 148 ++--
gdb/fbsd-tdep.c | 220 +++---
gdb/filesystem.c | 10 +-
gdb/findcmd.c | 10 +-
gdb/fork-child.c | 8 +-
gdb/frame.c | 50 +-
gdb/gcore.c | 14 +-
gdb/gdb-demangle.c | 22 +-
gdb/gdb_bfd.c | 4 +-
gdb/gdbarch.c | 938 ++++++++++++-------------
gdb/gdbarch.py | 14 +-
gdb/gdbtypes.c | 282 ++++----
gdb/gnu-nat.c | 82 +--
gdb/gnu-nat.h | 4 +-
gdb/gnu-v3-abi.c | 26 +-
gdb/go-valprint.c | 6 +-
gdb/go32-nat.c | 224 +++---
gdb/guile/guile.c | 6 +-
gdb/guile/scm-auto-load.c | 2 +-
gdb/guile/scm-objfile.c | 4 +-
gdb/guile/scm-param.c | 4 +-
gdb/guile/scm-pretty-print.c | 6 +-
gdb/h8300-tdep.c | 58 +-
gdb/hppa-tdep.c | 104 +--
gdb/i386-linux-tdep.c | 8 +-
gdb/i386-tdep.c | 90 +--
gdb/i387-tdep.c | 90 +--
gdb/ia64-libunwind-tdep.c | 8 +-
gdb/ia64-tdep.c | 142 ++--
gdb/inf-child.c | 2 +-
gdb/inf-loop.c | 2 +-
gdb/inf-ptrace.c | 12 +-
gdb/infcall.c | 30 +-
gdb/infcmd.c | 102 +--
gdb/inferior.c | 42 +-
gdb/inflow.c | 40 +-
gdb/infrun.c | 146 ++--
gdb/jit.c | 24 +-
gdb/language.c | 58 +-
gdb/linux-fork.c | 46 +-
gdb/linux-nat.c | 8 +-
gdb/linux-record.c | 188 ++---
gdb/linux-tdep.c | 248 +++----
gdb/linux-thread-db.c | 52 +-
gdb/m2-lang.c | 6 +-
gdb/m2-typeprint.c | 82 +--
gdb/m2-valprint.c | 28 +-
gdb/m68hc11-tdep.c | 74 +-
gdb/macrocmd.c | 36 +-
gdb/main.c | 40 +-
gdb/maint-test-options.c | 32 +-
gdb/maint-test-settings.c | 2 +-
gdb/maint.c | 136 ++--
gdb/make-target-delegates.py | 4 +-
gdb/mdebugread.c | 30 +-
gdb/memattr.c | 82 +--
gdb/mi/mi-cmd-var.c | 6 +-
gdb/mi/mi-interp.c | 130 ++--
gdb/mi/mi-main.c | 20 +-
gdb/mi/mi-out.c | 10 +-
gdb/minsyms.c | 42 +-
gdb/mips-linux-nat.c | 30 +-
gdb/mips-tdep.c | 542 +++++++-------
gdb/mn10300-tdep.c | 4 +-
gdb/moxie-tdep.c | 14 +-
gdb/netbsd-nat.c | 130 ++--
gdb/netbsd-tdep.c | 46 +-
gdb/nios2-tdep.c | 24 +-
gdb/nto-procfs.c | 90 +--
gdb/objc-lang.c | 20 +-
gdb/observable.c | 2 +-
gdb/or1k-tdep.c | 42 +-
gdb/osabi.c | 16 +-
gdb/p-lang.c | 10 +-
gdb/p-typeprint.c | 154 ++--
gdb/p-valprint.c | 32 +-
gdb/parse.c | 6 +-
gdb/ppc-linux-tdep.c | 6 +-
gdb/printcmd.c | 310 ++++-----
gdb/procfs.c | 110 +--
gdb/progspace.c | 12 +-
gdb/psymtab.c | 208 +++---
gdb/python/py-auto-load.c | 2 +-
gdb/python/py-breakpoint.c | 2 +-
gdb/python/py-framefilter.c | 2 +-
gdb/python/py-micmd.c | 2 +-
gdb/python/py-param.c | 8 +-
gdb/python/py-prettyprint.c | 6 +-
gdb/python/py-unwind.c | 2 +-
gdb/python/py-utils.c | 6 +-
gdb/python/python.c | 32 +-
gdb/ravenscar-thread.c | 4 +-
gdb/record-btrace.c | 62 +-
gdb/record-full.c | 286 ++++----
gdb/record.c | 20 +-
gdb/regcache-dump.c | 30 +-
gdb/regcache.c | 66 +-
gdb/reggroups.c | 6 +-
gdb/remote-fileio.c | 4 +-
gdb/remote-notif.c | 16 +-
gdb/remote-sim.c | 84 +--
gdb/remote.c | 174 ++---
gdb/reverse.c | 16 +-
gdb/riscv-tdep.c | 224 +++---
gdb/rs6000-aix-nat.c | 18 +-
gdb/rs6000-tdep.c | 36 +-
gdb/rust-lang.c | 46 +-
gdb/rust-lang.h | 14 +-
gdb/s12z-tdep.c | 4 +-
gdb/s390-linux-nat.c | 8 +-
gdb/s390-linux-tdep.c | 8 +-
gdb/s390-tdep.c | 60 +-
gdb/ser-base.c | 16 +-
gdb/ser-go32.c | 30 +-
gdb/ser-tcp.c | 4 +-
gdb/ser-unix.c | 30 +-
gdb/serial.c | 26 +-
gdb/serial.h | 2 +-
gdb/skip.c | 52 +-
gdb/sol-thread.c | 42 +-
gdb/solib-aix.c | 2 +-
gdb/solib-dsbt.c | 80 +--
gdb/solib-frv.c | 78 +--
gdb/solib-svr4.c | 16 +-
gdb/solib.c | 24 +-
gdb/source-cache.c | 8 +-
gdb/source.c | 92 +--
gdb/sparc64-tdep.c | 12 +-
gdb/stack.c | 108 +--
gdb/stap-probe.c | 4 +-
gdb/symfile-debug.c | 212 +++---
gdb/symfile.c | 136 ++--
gdb/symmisc.c | 396 +++++------
gdb/symtab.c | 312 ++++-----
gdb/target-dcache.c | 6 +-
gdb/target-debug.h | 10 +-
gdb/target-delegates.c | 664 +++++++++---------
gdb/target-descriptions.c | 182 ++---
gdb/target.c | 184 ++---
gdb/thread.c | 48 +-
gdb/top.c | 208 +++---
gdb/tracectf.c | 2 +-
gdb/tracefile-tfile.c | 2 +-
gdb/tracefile.c | 4 +-
gdb/tracepoint.c | 354 +++++-----
gdb/tui/tui-layout.c | 2 +-
gdb/tui/tui-regs.c | 12 +-
gdb/tui/tui-win.c | 24 +-
gdb/typeprint.c | 70 +-
gdb/ui-file.h | 2 +-
gdb/unittests/command-def-selftests.c | 32 +-
gdb/user-regs.c | 4 +-
gdb/utils.c | 72 +-
gdb/utils.h | 9 +-
gdb/valops.c | 46 +-
gdb/valprint.c | 176 ++---
gdb/value.c | 56 +-
gdb/varobj.c | 8 +-
gdb/windows-nat.c | 46 +-
gdb/windows-tdep.c | 28 +-
gdb/xml-support.c | 10 +-
gdb/xtensa-tdep.c | 24 +-
249 files changed, 8456 insertions(+), 8470 deletions(-)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index cb132d5a540..55094b3d88b 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1489,10 +1489,10 @@ aarch64_linux_syscall_record (struct regcache *regcache,
if (syscall_gdb < 0)
{
- fprintf_unfiltered (gdb_stderr,
- _("Process record and replay target doesn't "
- "support syscall number %s\n"),
- plongest (svc_number));
+ gdb_printf (gdb_stderr,
+ _("Process record and replay target doesn't "
+ "support syscall number %s\n"),
+ plongest (svc_number));
return -1;
}
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index b714f6194b6..9a14c4d59dc 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -214,7 +214,7 @@ static void
show_aarch64_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value);
+ gdb_printf (file, _("AArch64 debugging is %s.\n"), value);
}
namespace {
@@ -3691,8 +3691,8 @@ aarch64_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
if (tdep == NULL)
return;
- fprintf_filtered (file, _("aarch64_dump_tdep: Lowest pc = 0x%s"),
- paddress (gdbarch, tdep->lowest_pc));
+ gdb_printf (file, _("aarch64_dump_tdep: Lowest pc = 0x%s"),
+ paddress (gdbarch, tdep->lowest_pc));
}
#if GDB_SELF_TEST
@@ -4696,11 +4696,11 @@ aarch64_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
ret = aarch64_record_decode_insn_handler (&aarch64_record);
if (ret == AARCH64_RECORD_UNSUPPORTED)
{
- fprintf_unfiltered (gdb_stderr,
- _("Process record does not support instruction "
- "0x%0x at address %s.\n"),
- aarch64_record.aarch64_insn,
- paddress (gdbarch, insn_addr));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support instruction "
+ "0x%0x at address %s.\n"),
+ aarch64_record.aarch64_insn,
+ paddress (gdbarch, insn_addr));
ret = -1;
}
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 0f772fd7b46..59cbb110116 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3485,7 +3485,7 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
{
struct type *type = sym->type ();
- fprintf_filtered (stream, "%s", sym->print_name ());
+ gdb_printf (stream, "%s", sym->print_name ());
if (!print_signatures
|| type == NULL
|| type->code () != TYPE_CODE_FUNC)
@@ -3495,20 +3495,20 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
{
int i;
- fprintf_filtered (stream, " (");
+ gdb_printf (stream, " (");
for (i = 0; i < type->num_fields (); ++i)
{
if (i > 0)
- fprintf_filtered (stream, "; ");
+ gdb_printf (stream, "; ");
ada_print_type (type->field (i).type (), NULL, stream, -1, 0,
flags);
}
- fprintf_filtered (stream, ")");
+ gdb_printf (stream, ")");
}
if (TYPE_TARGET_TYPE (type) != NULL
&& TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
{
- fprintf_filtered (stream, " return ");
+ gdb_printf (stream, " return ");
ada_print_type (TYPE_TARGET_TYPE (type), NULL, stream, -1, 0, flags);
}
}
@@ -3634,9 +3634,9 @@ See set/show multiple-symbol."));
if (select_mode == multiple_symbols_all && max_results > 1)
return nsyms;
- printf_filtered (_("[0] cancel\n"));
+ gdb_printf (_("[0] cancel\n"));
if (max_results > 1)
- printf_filtered (_("[1] all\n"));
+ gdb_printf (_("[1] all\n"));
sort_choices (syms, nsyms);
@@ -3650,14 +3650,14 @@ See set/show multiple-symbol."));
struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1);
- printf_filtered ("[%d] ", i + first_choice);
+ gdb_printf ("[%d] ", i + first_choice);
ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options);
if (sal.symtab == NULL)
- printf_filtered (_(" at %p[<no source file available>%p]:%d\n"),
- metadata_style.style ().ptr (), nullptr, sal.line);
+ gdb_printf (_(" at %p[<no source file available>%p]:%d\n"),
+ metadata_style.style ().ptr (), nullptr, sal.line);
else
- printf_filtered
+ gdb_printf
(_(" at %ps:%d\n"),
styled_string (file_name_style.style (),
symtab_to_filename_for_display (sal.symtab)),
@@ -3677,37 +3677,37 @@ See set/show multiple-symbol."));
if (syms[i].symbol->line () != 0 && symtab != NULL)
{
- printf_filtered ("[%d] ", i + first_choice);
+ gdb_printf ("[%d] ", i + first_choice);
ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options);
- printf_filtered (_(" at %s:%d\n"),
- symtab_to_filename_for_display (symtab),
- syms[i].symbol->line ());
+ gdb_printf (_(" at %s:%d\n"),
+ symtab_to_filename_for_display (symtab),
+ syms[i].symbol->line ());
}
else if (is_enumeral
&& syms[i].symbol->type ()->name () != NULL)
{
- printf_filtered (("[%d] "), i + first_choice);
+ gdb_printf (("[%d] "), i + first_choice);
ada_print_type (syms[i].symbol->type (), NULL,
gdb_stdout, -1, 0, &type_print_raw_options);
- printf_filtered (_("'(%s) (enumeral)\n"),
- syms[i].symbol->print_name ());
+ gdb_printf (_("'(%s) (enumeral)\n"),
+ syms[i].symbol->print_name ());
}
else
{
- printf_filtered ("[%d] ", i + first_choice);
+ gdb_printf ("[%d] ", i + first_choice);
ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options);
if (symtab != NULL)
- printf_filtered (is_enumeral
- ? _(" in %s (enumeral)\n")
- : _(" at %s:?\n"),
- symtab_to_filename_for_display (symtab));
+ gdb_printf (is_enumeral
+ ? _(" in %s (enumeral)\n")
+ : _(" at %s:?\n"),
+ symtab_to_filename_for_display (symtab));
else
- printf_filtered (is_enumeral
- ? _(" (enumeral)\n")
- : _(" at ?\n"));
+ gdb_printf (is_enumeral
+ ? _(" (enumeral)\n")
+ : _(" at ?\n"));
}
}
}
@@ -3870,7 +3870,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
}
else
{
- printf_filtered (_("Multiple matches for %s\n"), sym->print_name ());
+ gdb_printf (_("Multiple matches for %s\n"), sym->print_name ());
user_select_syms (candidates.data (), candidates.size (), 1);
i = 0;
}
@@ -4053,7 +4053,7 @@ ada_resolve_function (std::vector<struct block_symbol> &syms,
return -1;
else if (m > 1 && !parse_completion)
{
- printf_filtered (_("Multiple matches for %s\n"), name);
+ gdb_printf (_("Multiple matches for %s\n"), name);
user_select_syms (syms.data (), m, 1);
return 0;
}
@@ -9466,7 +9466,7 @@ ada_aggregate_component::uses_objfile (struct objfile *objfile)
void
ada_aggregate_component::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sAggregate\n"), depth, "");
+ gdb_printf (stream, _("%*sAggregate\n"), depth, "");
for (const auto &item : m_components)
item->dump (stream, depth + 1);
}
@@ -9533,8 +9533,8 @@ ada_positional_component::uses_objfile (struct objfile *objfile)
void
ada_positional_component::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sPositional, index = %d\n"),
- depth, "", m_index);
+ gdb_printf (stream, _("%*sPositional, index = %d\n"),
+ depth, "", m_index);
m_op->dump (stream, depth + 1);
}
@@ -9568,7 +9568,7 @@ ada_discrete_range_association::uses_objfile (struct objfile *objfile)
void
ada_discrete_range_association::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sDiscrete range:\n"), depth, "");
+ gdb_printf (stream, _("%*sDiscrete range:\n"), depth, "");
m_low->dump (stream, depth + 1);
m_high->dump (stream, depth + 1);
}
@@ -9604,7 +9604,7 @@ ada_name_association::uses_objfile (struct objfile *objfile)
void
ada_name_association::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sName:\n"), depth, "");
+ gdb_printf (stream, _("%*sName:\n"), depth, "");
m_val->dump (stream, depth + 1);
}
@@ -9662,7 +9662,7 @@ ada_choices_component::uses_objfile (struct objfile *objfile)
void
ada_choices_component::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sChoices:\n"), depth, "");
+ gdb_printf (stream, _("%*sChoices:\n"), depth, "");
m_op->dump (stream, depth + 1);
for (const auto &item : m_assocs)
item->dump (stream, depth + 1);
@@ -9691,7 +9691,7 @@ ada_others_component::uses_objfile (struct objfile *objfile)
void
ada_others_component::dump (ui_file *stream, int depth)
{
- fprintf_filtered (stream, _("%*sOthers:\n"), depth, "");
+ gdb_printf (stream, _("%*sOthers:\n"), depth, "");
m_op->dump (stream, depth + 1);
}
@@ -12460,21 +12460,21 @@ print_recreate_exception (struct breakpoint *b, struct ui_file *fp)
switch (c->m_kind)
{
case ada_catch_exception:
- fprintf_filtered (fp, "catch exception");
+ gdb_printf (fp, "catch exception");
if (!c->excep_string.empty ())
- fprintf_filtered (fp, " %s", c->excep_string.c_str ());
+ gdb_printf (fp, " %s", c->excep_string.c_str ());
break;
case ada_catch_exception_unhandled:
- fprintf_filtered (fp, "catch exception unhandled");
+ gdb_printf (fp, "catch exception unhandled");
break;
case ada_catch_handlers:
- fprintf_filtered (fp, "catch handlers");
+ gdb_printf (fp, "catch handlers");
break;
case ada_catch_assert:
- fprintf_filtered (fp, "catch assert");
+ gdb_printf (fp, "catch assert");
break;
default:
@@ -13155,13 +13155,13 @@ info_exceptions_command (const char *regexp, int from_tty)
std::vector<ada_exc_info> exceptions = ada_exceptions_list (regexp);
if (regexp != NULL)
- printf_filtered
+ gdb_printf
(_("All Ada exceptions matching regular expression \"%s\":\n"), regexp);
else
- printf_filtered (_("All defined Ada exceptions:\n"));
+ gdb_printf (_("All defined Ada exceptions:\n"));
for (const ada_exc_info &info : exceptions)
- printf_filtered ("%s: %s\n", info.name, paddress (gdbarch, info.addr));
+ gdb_printf ("%s: %s\n", info.name, paddress (gdbarch, info.addr));
}
\f
@@ -13392,7 +13392,7 @@ public:
struct value *index_value = val_atr (index_type, index);
value_print (index_value, stream, options);
- fprintf_filtered (stream, " => ");
+ gdb_printf (stream, " => ");
}
/* Implement the "read_var_value" language_defn method for Ada. */
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 6a41d5f4b2b..5622772b013 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -1223,23 +1223,23 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
task_info = &data->task_list[taskno - 1];
/* Print the Ada task ID. */
- printf_filtered (_("Ada Task: %s\n"),
- paddress (target_gdbarch (), task_info->task_id));
+ gdb_printf (_("Ada Task: %s\n"),
+ paddress (target_gdbarch (), task_info->task_id));
/* Print the name of the task. */
if (task_info->name[0] != '\0')
- printf_filtered (_("Name: %s\n"), task_info->name);
+ gdb_printf (_("Name: %s\n"), task_info->name);
else
fprintf_styled (gdb_stdout, metadata_style.style (), _("<no name>\n"));
/* Print the TID and LWP. */
- printf_filtered (_("Thread: 0x%s\n"), phex_nz (task_info->ptid.tid (),
- sizeof (ULONGEST)));
- printf_filtered (_("LWP: %#lx\n"), task_info->ptid.lwp ());
+ gdb_printf (_("Thread: 0x%s\n"), phex_nz (task_info->ptid.tid (),
+ sizeof (ULONGEST)));
+ gdb_printf (_("LWP: %#lx\n"), task_info->ptid.lwp ());
/* If set, print the base CPU. */
if (task_info->base_cpu != 0)
- printf_filtered (_("Base CPU: %d\n"), task_info->base_cpu);
+ gdb_printf (_("Base CPU: %d\n"), task_info->base_cpu);
/* Print who is the parent (if any). */
if (task_info->parent != 0)
@@ -1248,16 +1248,16 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
{
struct ada_task_info *parent = &data->task_list[parent_taskno - 1];
- printf_filtered (_("Parent: %d"), parent_taskno);
+ gdb_printf (_("Parent: %d"), parent_taskno);
if (parent->name[0] != '\0')
- printf_filtered (" (%s)", parent->name);
- printf_filtered ("\n");
+ gdb_printf (" (%s)", parent->name);
+ gdb_printf ("\n");
}
else
- printf_filtered (_("No parent\n"));
+ gdb_printf (_("No parent\n"));
/* Print the base priority. */
- printf_filtered (_("Base Priority: %d\n"), task_info->priority);
+ gdb_printf (_("Base Priority: %d\n"), task_info->priority);
/* print the task current state. */
{
@@ -1266,27 +1266,27 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
if (task_info->caller_task)
{
target_taskno = get_task_number_from_id (task_info->caller_task, inf);
- printf_filtered (_("State: Accepting rendezvous with %d"),
- target_taskno);
+ gdb_printf (_("State: Accepting rendezvous with %d"),
+ target_taskno);
}
else if (task_info->called_task)
{
target_taskno = get_task_number_from_id (task_info->called_task, inf);
- printf_filtered (_("State: Waiting on task %d's entry"),
- target_taskno);
+ gdb_printf (_("State: Waiting on task %d's entry"),
+ target_taskno);
}
else
- printf_filtered (_("State: %s"), _(long_task_states[task_info->state]));
+ gdb_printf (_("State: %s"), _(long_task_states[task_info->state]));
if (target_taskno)
{
ada_task_info *target_task_info = &data->task_list[target_taskno - 1];
if (target_task_info->name[0] != '\0')
- printf_filtered (" (%s)", target_task_info->name);
+ gdb_printf (" (%s)", target_task_info->name);
}
- printf_filtered ("\n");
+ gdb_printf ("\n");
}
}
@@ -1316,15 +1316,15 @@ display_current_task_id (void)
const int current_task = ada_get_task_number (inferior_thread ());
if (current_task == 0)
- printf_filtered (_("[Current task is unknown]\n"));
+ gdb_printf (_("[Current task is unknown]\n"));
else
{
struct ada_tasks_inferior_data *data
= get_ada_tasks_inferior_data (current_inferior ());
struct ada_task_info *task_info = &data->task_list[current_task - 1];
- printf_filtered (_("[Current task is %s]\n"),
- task_to_str (current_task, task_info).c_str ());
+ gdb_printf (_("[Current task is %s]\n"),
+ task_to_str (current_task, task_info).c_str ());
}
}
@@ -1372,8 +1372,8 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
switch_to_thread (tp);
ada_find_printable_frame (get_selected_frame (NULL));
- printf_filtered (_("[Switching to task %s]\n"),
- task_to_str (taskno, task_info).c_str ());
+ gdb_printf (_("[Switching to task %s]\n"),
+ task_to_str (taskno, task_info).c_str ());
print_stack_frame (get_selected_frame (NULL),
frame_relative_level (get_selected_frame (NULL)),
SRC_AND_LOC, 1);
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index ee382ebf2c6..0eb95cb0a73 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -166,22 +166,22 @@ print_range (struct type *type, struct ui_file *stream,
access to an actual object, which is not available
when the user is using the "ptype" command on a type.
Print the range as an unbounded range. */
- fprintf_filtered (stream, "<>");
+ gdb_printf (stream, "<>");
got_error = 1;
}
if (!got_error)
{
ada_print_scalar (type, lo, stream);
- fprintf_filtered (stream, " .. ");
+ gdb_printf (stream, " .. ");
ada_print_scalar (type, hi, stream);
}
}
break;
default:
- fprintf_filtered (stream, "%.*s",
- ada_name_prefix_len (type->name ()),
- type->name ());
+ gdb_printf (stream, "%.*s",
+ ada_name_prefix_len (type->name ()),
+ type->name ());
break;
}
}
@@ -228,7 +228,7 @@ print_range_bound (struct type *type, const char *bounds, int *n,
bound_len = pend - bound;
*n += bound_len + 2;
}
- fprintf_filtered (stream, "%.*s", bound_len, bound);
+ gdb_printf (stream, "%.*s", bound_len, bound);
}
}
@@ -247,7 +247,7 @@ print_dynamic_range_bound (struct type *type, const char *name, int name_len,
if (get_int_var_value (name_buf.c_str (), B))
ada_print_scalar (type, B, stream);
else
- fprintf_filtered (stream, "?");
+ gdb_printf (stream, "?");
}
/* Print RAW_TYPE as a range type, using any bound information
@@ -297,7 +297,7 @@ print_range_type (struct type *raw_type, struct ui_file *stream,
print_dynamic_range_bound (base_type, name, prefix_len, "___L",
stream);
- fprintf_filtered (stream, " .. ");
+ gdb_printf (stream, " .. ");
if (*subtype_info == 'U')
print_range_bound (base_type, bounds_str, &n, stream);
@@ -316,7 +316,7 @@ print_enum_type (struct type *type, struct ui_file *stream)
int i;
LONGEST lastval;
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
stream->wrap_here (1);
lastval = 0;
@@ -324,19 +324,19 @@ print_enum_type (struct type *type, struct ui_file *stream)
{
QUIT;
if (i)
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
stream->wrap_here (4);
fputs_styled (ada_enum_name (type->field (i).name ()),
variable_name_style.style (), stream);
if (lastval != type->field (i).loc_enumval ())
{
- fprintf_filtered (stream, " => %s",
- plongest (type->field (i).loc_enumval ()));
+ gdb_printf (stream, " => %s",
+ plongest (type->field (i).loc_enumval ()));
lastval = type->field (i).loc_enumval ();
}
lastval += 1;
}
- fprintf_filtered (stream, ")");
+ gdb_printf (stream, ")");
}
/* Print simple (constrained) array type TYPE on STREAM. LEVEL is the
@@ -356,7 +356,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
type = ada_coerce_to_simple_array_type (type);
bitsize = 0;
- fprintf_filtered (stream, "array (");
+ gdb_printf (stream, "array (");
if (type == NULL)
{
@@ -381,7 +381,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
arr_type = TYPE_TARGET_TYPE (arr_type))
{
if (arr_type != type)
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
print_range (arr_type->index_type (), stream,
0 /* bounds_prefered_p */);
if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0)
@@ -398,7 +398,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
k += 1, arr_type = TYPE_TARGET_TYPE (arr_type))
{
if (k > 0)
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
print_range_type (range_desc_type->field (k).type (),
stream, 0 /* bounds_prefered_p */);
if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0)
@@ -411,11 +411,11 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
int i, i0;
for (i = i0 = ada_array_arity (type); i > 0; i -= 1)
- fprintf_filtered (stream, "%s<>", i == i0 ? "" : ", ");
+ gdb_printf (stream, "%s<>", i == i0 ? "" : ", ");
}
elt_type = ada_array_element_type (type, n_indices);
- fprintf_filtered (stream, ") of ");
+ gdb_printf (stream, ") of ");
stream->wrap_here (0);
ada_print_type (elt_type, "", stream, show == 0 ? 0 : show - 1, level + 1,
flags);
@@ -423,7 +423,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
compilers have to describe their stride so that we can properly fetch
individual elements. Do not say the array is packed in this case. */
if (bitsize > 0 && !is_dynamic_type (elt_type))
- fprintf_filtered (stream, " <packed: %d-bit elements>", bitsize);
+ gdb_printf (stream, " <packed: %d-bit elements>", bitsize);
}
/* Print the choices encoded by field FIELD_NUM of variant-part TYPE on
@@ -460,13 +460,13 @@ print_choices (struct type *type, int field_num, struct ui_file *stream,
goto Huh;
case '_':
case '\0':
- fprintf_filtered (stream, " =>");
+ gdb_printf (stream, " =>");
return 1;
case 'S':
case 'R':
case 'O':
if (have_output)
- fprintf_filtered (stream, " | ");
+ gdb_printf (stream, " | ");
have_output = 1;
break;
}
@@ -490,19 +490,19 @@ print_choices (struct type *type, int field_num, struct ui_file *stream,
|| name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
goto Huh;
ada_print_scalar (val_type, L, stream);
- fprintf_filtered (stream, " .. ");
+ gdb_printf (stream, " .. ");
ada_print_scalar (val_type, U, stream);
break;
}
case 'O':
- fprintf_filtered (stream, "others");
+ gdb_printf (stream, "others");
p += 1;
break;
}
}
Huh:
- fprintf_filtered (stream, "? =>");
+ gdb_printf (stream, "? =>");
return 0;
}
@@ -520,14 +520,14 @@ print_variant_clauses (struct type *var_type, struct type *discr_type,
{
for (int i = 0; i < var_type->num_fields (); i += 1)
{
- fprintf_filtered (stream, "\n%*swhen ", level, "");
+ gdb_printf (stream, "\n%*swhen ", level, "");
if (print_choices (var_type, i, stream, discr_type))
{
if (print_record_field_types (var_type->field (i).type (),
outer_type, stream, show, level,
flags)
<= 0)
- fprintf_filtered (stream, " null;");
+ gdb_printf (stream, " null;");
}
else
print_selected_record_field_types (var_type, outer_type, i, i,
@@ -588,10 +588,10 @@ print_variant_part (struct type *type, int field_num, struct type *outer_type,
if (*variant == '\0')
variant = "?";
- fprintf_filtered (stream, "\n%*scase %s is", level + 4, "", variant);
+ gdb_printf (stream, "\n%*scase %s is", level + 4, "", variant);
print_variant_clauses (type, field_num, outer_type, stream, show,
level + 4, flags);
- fprintf_filtered (stream, "\n%*send case;", level + 4, "");
+ gdb_printf (stream, "\n%*send case;", level + 4, "");
}
/* Print a description on STREAM of the fields FLD0 through FLD1 in
@@ -633,11 +633,11 @@ print_selected_record_field_types (struct type *type, struct type *outer_type,
else
{
flds += 1;
- fprintf_filtered (stream, "\n%*s", level + 4, "");
+ gdb_printf (stream, "\n%*s", level + 4, "");
ada_print_type (type->field (i).type (),
type->field (i).name (),
stream, show - 1, level + 4, flags);
- fprintf_filtered (stream, ";");
+ gdb_printf (stream, ";");
}
}
@@ -657,16 +657,16 @@ static void
print_choices (struct type *discr_type, const variant &variant,
struct ui_file *stream, int level)
{
- fprintf_filtered (stream, "\n%*swhen ", level, "");
+ gdb_printf (stream, "\n%*swhen ", level, "");
if (variant.is_default ())
- fprintf_filtered (stream, "others");
+ gdb_printf (stream, "others");
else
{
bool first = true;
for (const discriminant_range &range : variant.discriminants)
{
if (!first)
- fprintf_filtered (stream, " | ");
+ gdb_printf (stream, " | ");
first = false;
ada_print_scalar (discr_type, range.low, stream);
@@ -675,7 +675,7 @@ print_choices (struct type *discr_type, const variant &variant,
}
}
- fprintf_filtered (stream, " =>");
+ gdb_printf (stream, " =>");
}
/* Print a single variant part, PART, on STREAM. TYPE is the
@@ -701,7 +701,7 @@ print_variant_part (const variant_part &part,
discr_type = type->field (part.discriminant_index).type ();
}
- fprintf_filtered (stream, "\n%*scase %s is", level + 4, "", name);
+ gdb_printf (stream, "\n%*scase %s is", level + 4, "", name);
int last_field = -1;
for (const variant &variant : part.variants)
@@ -709,7 +709,7 @@ print_variant_part (const variant_part &part,
print_choices (discr_type, variant, stream, level + 8);
if (variant.first_field == variant.last_field)
- fprintf_filtered (stream, " null;");
+ gdb_printf (stream, " null;");
else
{
print_record_field_types_dynamic (variant.parts,
@@ -720,7 +720,7 @@ print_variant_part (const variant_part &part,
}
}
- fprintf_filtered (stream, "\n%*send case;", level + 4, "");
+ gdb_printf (stream, "\n%*send case;", level + 4, "");
return last_field;
}
@@ -813,15 +813,15 @@ print_record_type (struct type *type0, struct ui_file *stream, int show,
prevents a crash trying to print a NULL pointer. */
if (parent_name == NULL)
parent_name = ada_type_name (parent_type);
- fprintf_filtered (stream, "new %s with record", parent_name);
+ gdb_printf (stream, "new %s with record", parent_name);
}
else if (parent_type == NULL && ada_is_tagged_type (type, 0))
- fprintf_filtered (stream, "tagged record");
+ gdb_printf (stream, "tagged record");
else
- fprintf_filtered (stream, "record");
+ gdb_printf (stream, "record");
if (show < 0)
- fprintf_filtered (stream, " ... end record");
+ gdb_printf (stream, " ... end record");
else
{
int flds;
@@ -834,11 +834,11 @@ print_record_type (struct type *type0, struct ui_file *stream, int show,
flags);
if (flds > 0)
- fprintf_filtered (stream, "\n%*send record", level, "");
+ gdb_printf (stream, "\n%*send record", level, "");
else if (flds < 0)
- fprintf_filtered (stream, _(" <incomplete type> end record"));
+ gdb_printf (stream, _(" <incomplete type> end record"));
else
- fprintf_filtered (stream, " null; end record");
+ gdb_printf (stream, " null; end record");
}
}
@@ -852,17 +852,17 @@ print_unchecked_union_type (struct type *type, struct ui_file *stream,
const struct type_print_options *flags)
{
if (show < 0)
- fprintf_filtered (stream, "record (?) is ... end record");
+ gdb_printf (stream, "record (?) is ... end record");
else if (type->num_fields () == 0)
- fprintf_filtered (stream, "record (?) is null; end record");
+ gdb_printf (stream, "record (?) is null; end record");
else
{
- fprintf_filtered (stream, "record (?) is\n%*scase ? is", level + 4, "");
+ gdb_printf (stream, "record (?) is\n%*scase ? is", level + 4, "");
print_variant_clauses (type, nullptr, type, stream, show, level + 8, flags);
- fprintf_filtered (stream, "\n%*send case;\n%*send record",
- level + 4, "", level, "");
+ gdb_printf (stream, "\n%*send case;\n%*send record",
+ level + 4, "", level, "");
}
}
@@ -879,9 +879,9 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
if (TYPE_TARGET_TYPE (type) != NULL
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)
- fprintf_filtered (stream, "procedure");
+ gdb_printf (stream, "procedure");
else
- fprintf_filtered (stream, "function");
+ gdb_printf (stream, "function");
if (name != NULL && name[0] != '\0')
{
@@ -891,7 +891,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
if (len > 0)
{
- fprintf_filtered (stream, " (");
+ gdb_printf (stream, " (");
for (i = 0; i < len; i += 1)
{
if (i > 0)
@@ -899,18 +899,18 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
gdb_puts ("; ", stream);
stream->wrap_here (4);
}
- fprintf_filtered (stream, "a%d: ", i + 1);
+ gdb_printf (stream, "a%d: ", i + 1);
ada_print_type (type->field (i).type (), "", stream, -1, 0,
flags);
}
- fprintf_filtered (stream, ")");
+ gdb_printf (stream, ")");
}
if (TYPE_TARGET_TYPE (type) == NULL)
- fprintf_filtered (stream, " return <unknown return type>");
+ gdb_printf (stream, " return <unknown return type>");
else if (TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID)
{
- fprintf_filtered (stream, " return ");
+ gdb_printf (stream, " return ");
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, 0, flags);
}
}
@@ -954,20 +954,20 @@ ada_print_type (struct type *type0, const char *varstring,
if (type == NULL)
{
if (is_var_decl)
- fprintf_filtered (stream, "%.*s: ",
- ada_name_prefix_len (varstring), varstring);
+ gdb_printf (stream, "%.*s: ",
+ ada_name_prefix_len (varstring), varstring);
fprintf_styled (stream, metadata_style.style (), "<null type?>");
return;
}
if (is_var_decl && type->code () != TYPE_CODE_FUNC)
- fprintf_filtered (stream, "%.*s: ",
- ada_name_prefix_len (varstring), varstring);
+ gdb_printf (stream, "%.*s: ",
+ ada_name_prefix_len (varstring), varstring);
if (type_name != NULL && show <= 0 && !ada_is_aligner_type (type))
{
- fprintf_filtered (stream, "%.*s",
- ada_name_prefix_len (type_name), type_name);
+ gdb_printf (stream, "%.*s",
+ ada_name_prefix_len (type_name), type_name);
return;
}
@@ -980,9 +980,9 @@ ada_print_type (struct type *type0, const char *varstring,
switch (type->code ())
{
default:
- fprintf_filtered (stream, "<");
+ gdb_printf (stream, "<");
c_print_type (type, "", stream, show, level, flags);
- fprintf_filtered (stream, ">");
+ gdb_printf (stream, ">");
break;
case TYPE_CODE_PTR:
case TYPE_CODE_TYPEDEF:
@@ -990,12 +990,12 @@ ada_print_type (struct type *type0, const char *varstring,
"access" in this case. */
if (type->code () != TYPE_CODE_PTR
|| strstr (varstring, "___XVL") == nullptr)
- fprintf_filtered (stream, "access ");
+ gdb_printf (stream, "access ");
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level,
flags);
break;
case TYPE_CODE_REF:
- fprintf_filtered (stream, "<ref> ");
+ gdb_printf (stream, "<ref> ");
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level,
flags);
break;
@@ -1003,7 +1003,7 @@ ada_print_type (struct type *type0, const char *varstring,
print_array_type (type, stream, show, level, flags);
break;
case TYPE_CODE_BOOL:
- fprintf_filtered (stream, "(false, true)");
+ gdb_printf (stream, "(false, true)");
break;
case TYPE_CODE_INT:
{
@@ -1015,7 +1015,7 @@ ada_print_type (struct type *type0, const char *varstring,
pulongest (TYPE_LENGTH (type)));
else
{
- fprintf_filtered (stream, "range ");
+ gdb_printf (stream, "range ");
print_range_type (type, stream, 1 /* bounds_prefered_p */);
}
}
@@ -1023,16 +1023,16 @@ ada_print_type (struct type *type0, const char *varstring,
case TYPE_CODE_RANGE:
if (is_fixed_point_type (type))
{
- fprintf_filtered (stream, "<");
+ gdb_printf (stream, "<");
print_type_fixed_point (type, stream);
- fprintf_filtered (stream, ">");
+ gdb_printf (stream, ">");
}
else if (ada_is_modular_type (type))
- fprintf_filtered (stream, "mod %s",
- int_string (ada_modulus (type), 10, 0, 0, 1));
+ gdb_printf (stream, "mod %s",
+ int_string (ada_modulus (type), 10, 0, 0, 1));
else
{
- fprintf_filtered (stream, "range ");
+ gdb_printf (stream, "range ");
print_range (type, stream, 1 /* bounds_prefered_p */);
}
break;
@@ -1043,7 +1043,7 @@ ada_print_type (struct type *type0, const char *varstring,
break;
case TYPE_CODE_ENUM:
if (show < 0)
- fprintf_filtered (stream, "(...)");
+ gdb_printf (stream, "(...)");
else
print_enum_type (type, stream);
break;
@@ -1051,8 +1051,8 @@ ada_print_type (struct type *type0, const char *varstring,
if (ada_is_array_descriptor_type (type))
print_array_type (type, stream, show, level, flags);
else if (ada_is_bogus_array_descriptor (type))
- fprintf_filtered (stream,
- _("array (?) of ? (<mal-formed descriptor>)"));
+ gdb_printf (stream,
+ _("array (?) of ? (<mal-formed descriptor>)"));
else
print_record_type (type, stream, show, level, flags);
break;
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index f125a387acb..2db311110a3 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -106,7 +106,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
}
ada_print_scalar (index_type, low_bound, stream);
- fprintf_filtered (stream, " => ");
+ gdb_printf (stream, " => ");
return 1;
}
@@ -165,17 +165,17 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
{
if (options->prettyformat_arrays)
{
- fprintf_filtered (stream, ",\n");
+ gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
{
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
}
}
else if (options->prettyformat_arrays)
{
- fprintf_filtered (stream, "\n");
+ gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
stream->wrap_here (2 + 2 * recurse);
@@ -211,8 +211,8 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
opts.deref_ref = 0;
common_val_print (v0, stream, recurse + 1, &opts, current_language);
annotate_elt_rep (i - i0);
- fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"),
- metadata_style.style ().ptr (), i - i0, nullptr);
+ gdb_printf (stream, _(" %p[<repeats %u times>%p]"),
+ metadata_style.style ().ptr (), i - i0, nullptr);
annotate_elt_rep_end ();
}
@@ -228,12 +228,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
{
if (options->prettyformat_arrays)
{
- fprintf_filtered (stream, ",\n");
+ gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
{
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
}
stream->wrap_here (2 + 2 * recurse);
maybe_print_array_index (index_type, j + low,
@@ -249,7 +249,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
annotate_array_section_end ();
if (i < len)
{
- fprintf_filtered (stream, "...");
+ gdb_printf (stream, "...");
}
value_free_to_mark (mark);
@@ -272,15 +272,15 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream,
if (c <= UCHAR_MAX && isascii (c) && isprint (c))
{
if (c == quoter && c == '"')
- fprintf_filtered (stream, "\"\"");
+ gdb_printf (stream, "\"\"");
else
- fprintf_filtered (stream, "%c", c);
+ gdb_printf (stream, "%c", c);
}
else
{
/* Follow GNAT's lead here and only use 6 digits for
wide_wide_character. */
- fprintf_filtered (stream, "[\"%0*x\"]", std::min (6, type_len * 2), c);
+ gdb_printf (stream, "[\"%0*x\"]", std::min (6, type_len * 2), c);
}
}
@@ -351,12 +351,12 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
{
pos = s.find ('e');
if (pos == std::string::npos)
- fprintf_filtered (stream, "%s.0", s.c_str ());
+ gdb_printf (stream, "%s.0", s.c_str ());
else
- fprintf_filtered (stream, "%.*s.0%s", (int) pos, s.c_str (), &s[pos]);
+ gdb_printf (stream, "%.*s.0%s", (int) pos, s.c_str (), &s[pos]);
}
else
- fprintf_filtered (stream, "%s", &s[skip_count]);
+ gdb_printf (stream, "%s", &s[skip_count]);
}
void
@@ -417,7 +417,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
break;
case TYPE_CODE_BOOL:
- fprintf_filtered (stream, val ? "true" : "false");
+ gdb_printf (stream, val ? "true" : "false");
break;
case TYPE_CODE_RANGE:
@@ -507,8 +507,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
ada_emit_char (char_at (string, i, type_len, byte_order),
elttype, stream, '\'', type_len);
gdb_puts ("'", stream);
- fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"),
- metadata_style.style ().ptr (), reps, nullptr);
+ gdb_printf (stream, _(" %p[<repeats %u times>%p]"),
+ metadata_style.style ().ptr (), reps, nullptr);
i = rep1 - 1;
things_printed += options->repeat_count_threshold;
need_comma = 1;
@@ -615,12 +615,12 @@ print_field_values (struct value *value, struct value *outer_value,
}
if (comma_needed)
- fprintf_filtered (stream, ", ");
+ gdb_printf (stream, ", ");
comma_needed = 1;
if (options->prettyformat)
{
- fprintf_filtered (stream, "\n");
+ gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
@@ -629,9 +629,9 @@ print_field_values (struct value *value, struct value *outer_value,
}
annotate_field_begin (type->field (i).type ());
- fprintf_filtered (stream, "%.*s",
- ada_name_prefix_len (type->field (i).name ()),
- type->field (i).name ());
+ gdb_printf (stream, "%.*s",
+ ada_name_prefix_len (type->field (i).name ()),
+ type->field (i).name ());
annotate_field_name_end ();
gdb_puts (" => ", stream);
annotate_field_value ();
@@ -746,7 +746,7 @@ ada_value_print_ptr (struct value *val,
gdb::unique_xmalloc_ptr<char> name = ada_tag_name (val);
if (name != NULL)
- fprintf_filtered (stream, " (%s)", name.get ());
+ gdb_printf (stream, " (%s)", name.get ());
}
}
@@ -799,9 +799,9 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
CORE_ADDR addr = extract_typed_address (valaddr, ptr_type);
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") ");
+ gdb_printf (stream, ") ");
gdb_puts (paddress (gdbarch, addr), stream);
}
else
@@ -855,9 +855,9 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse,
const char *name = ada_enum_name (type->field (i).name ());
if (name[0] == '\'')
- fprintf_filtered (stream, "%ld %ps", (long) val,
- styled_string (variable_name_style.style (),
- name));
+ gdb_printf (stream, "%ld %ps", (long) val,
+ styled_string (variable_name_style.style (),
+ name));
else
fputs_styled (name, variable_name_style.style (), stream);
}
@@ -876,21 +876,21 @@ ada_val_print_struct_union (struct value *value,
{
if (ada_is_bogus_array_descriptor (value_type (value)))
{
- fprintf_filtered (stream, "(...?)");
+ gdb_printf (stream, "(...?)");
return;
}
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
if (print_field_values (value, value, stream, recurse, options,
0, language_def (language_ada)) != 0
&& options->prettyformat)
{
- fprintf_filtered (stream, "\n");
+ gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
- fprintf_filtered (stream, ")");
+ gdb_printf (stream, ")");
}
/* Implement Ada value_print'ing for the case where TYPE is a
@@ -914,7 +914,7 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse,
return;
}
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
print_optional_low_bound (stream, type, options);
if (value_entirely_optimized_out (val))
@@ -928,7 +928,7 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse,
}
else
value_print_array_elements (val, stream, recurse, options, 0);
- fprintf_filtered (stream, ")");
+ gdb_printf (stream, ")");
}
/* Implement Ada val_print'ing for the case where TYPE is
@@ -1010,7 +1010,7 @@ ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
if (val == nullptr)
{
gdb_assert (type->code () == TYPE_CODE_TYPEDEF);
- fprintf_filtered (stream, "0x0");
+ gdb_printf (stream, "0x0");
return;
}
}
@@ -1102,9 +1102,9 @@ ada_value_print (struct value *val0, struct ui_file *stream,
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_INT
|| TYPE_TARGET_TYPE (type)->is_unsigned ())
{
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") ");
+ gdb_printf (stream, ") ");
}
}
else if (ada_is_array_descriptor_type (type))
@@ -1114,16 +1114,16 @@ ada_value_print (struct value *val0, struct ui_file *stream,
a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */
if (type->code () == TYPE_CODE_TYPEDEF)
{
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") ");
+ gdb_printf (stream, ") ");
}
}
else if (ada_is_bogus_array_descriptor (type))
{
- fprintf_filtered (stream, "(");
+ gdb_printf (stream, "(");
type_print (type, "", stream, -1);
- fprintf_filtered (stream, ") (...?)");
+ gdb_printf (stream, ") (...?)");
return;
}
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index bf30faab66b..f88880614ec 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -612,10 +612,10 @@ addrmap_dump (struct addrmap *map, struct ui_file *outfile, void *payload)
addr_str = "<ends here>";
if (matches || previous_matched)
- fprintf_filtered (outfile, " %s%s %s\n",
- payload != nullptr ? " " : "",
- core_addr_to_string (start_addr),
- addr_str);
+ gdb_printf (outfile, " %s%s %s\n",
+ payload != nullptr ? " " : "",
+ core_addr_to_string (start_addr),
+ addr_str);
previous_matched = matches;
diff --git a/gdb/agent.c b/gdb/agent.c
index 5a6eac9ed08..28c1340f79d 100644
--- a/gdb/agent.c
+++ b/gdb/agent.c
@@ -40,9 +40,9 @@ static void
show_can_use_agent (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file,
- _("Debugger's willingness to use agent in inferior "
- "as a helper is %s.\n"), value);
+ gdb_printf (file,
+ _("Debugger's willingness to use agent in inferior "
+ "as a helper is %s.\n"), value);
}
static void
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 6a4b469788a..85be4c15f1c 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -266,9 +266,9 @@ ptrace_check (int req, int id, int ret)
if (ret == -1 && errno == EPERM)
{
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "ptrace (%d, %d) = %d (errno = %d)\n",
- req, id, ret, errno);
+ gdb_printf (gdb_stdlog,
+ "ptrace (%d, %d) = %d (errno = %d)\n",
+ req, id, ret, errno);
return ret == -1 ? 0 : 1;
}
break;
@@ -338,16 +338,16 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
char *name;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_symbol_addrs (user = %ld, symbols = 0x%lx, count = %d)\n",
- user, (long) symbols, count);
+ gdb_printf (gdb_stdlog,
+ "pdc_symbol_addrs (user = %ld, symbols = 0x%lx, count = %d)\n",
+ user, (long) symbols, count);
for (i = 0; i < count; i++)
{
name = symbols[i].name;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- " symbols[%d].name = \"%s\"\n", i, name);
+ gdb_printf (gdb_stdlog,
+ " symbols[%d].name = \"%s\"\n", i, name);
if (!*name)
symbols[i].addr = 0;
@@ -357,17 +357,17 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
if (ms.minsym == NULL)
{
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
+ gdb_printf (gdb_stdlog, " returning PDC_FAILURE\n");
return PDC_FAILURE;
}
symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
}
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n",
- i, hex_string (symbols[i].addr));
+ gdb_printf (gdb_stdlog, " symbols[%d].addr = %s\n",
+ i, hex_string (symbols[i].addr));
}
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, " returning PDC_SUCCESS\n");
+ gdb_printf (gdb_stdlog, " returning PDC_SUCCESS\n");
return PDC_SUCCESS;
}
@@ -396,8 +396,8 @@ pdc_read_regs (pthdb_user_t user,
struct ptsprs sprs32;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
- (int) tid, hex_string (flags));
+ gdb_printf (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
+ (int) tid, hex_string (flags));
/* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS)
@@ -462,8 +462,8 @@ pdc_write_regs (pthdb_user_t user,
however this code is untested. */
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
- (int) tid, hex_string (flags));
+ gdb_printf (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
+ (int) tid, hex_string (flags));
/* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS)
@@ -506,16 +506,16 @@ pdc_read_data (pthdb_user_t user, void *buf,
int status, ret;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
- user, (long) buf, hex_string (addr), len);
+ gdb_printf (gdb_stdlog,
+ "pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
+ user, (long) buf, hex_string (addr), len);
status = target_read_memory (addr, (gdb_byte *) buf, len);
ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n",
- status, pd_status2str (ret));
+ gdb_printf (gdb_stdlog, " status=%d, returning %s\n",
+ status, pd_status2str (ret));
return ret;
}
@@ -528,16 +528,16 @@ pdc_write_data (pthdb_user_t user, void *buf,
int status, ret;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
- user, (long) buf, hex_string (addr), len);
+ gdb_printf (gdb_stdlog,
+ "pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
+ user, (long) buf, hex_string (addr), len);
status = target_write_memory (addr, (gdb_byte *) buf, len);
ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n", status,
- pd_status2str (ret));
+ gdb_printf (gdb_stdlog, " status=%d, returning %s\n", status,
+ pd_status2str (ret));
return ret;
}
@@ -548,13 +548,13 @@ static int
pdc_alloc (pthdb_user_t user, size_t len, void **bufp)
{
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
- user, len, (long) bufp);
+ gdb_printf (gdb_stdlog,
+ "pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
+ user, len, (long) bufp);
*bufp = xmalloc (len);
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- " malloc returned 0x%lx\n", (long) *bufp);
+ gdb_printf (gdb_stdlog,
+ " malloc returned 0x%lx\n", (long) *bufp);
/* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never
be returned. */
@@ -570,13 +570,13 @@ static int
pdc_realloc (pthdb_user_t user, void *buf, size_t len, void **bufp)
{
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_realloc (user = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n",
- user, (long) buf, len, (long) bufp);
+ gdb_printf (gdb_stdlog,
+ "pdc_realloc (user = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n",
+ user, (long) buf, len, (long) bufp);
*bufp = xrealloc (buf, len);
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- " realloc returned 0x%lx\n", (long) *bufp);
+ gdb_printf (gdb_stdlog,
+ " realloc returned 0x%lx\n", (long) *bufp);
return *bufp ? PDC_SUCCESS : PDC_FAILURE;
}
@@ -587,9 +587,9 @@ static int
pdc_dealloc (pthdb_user_t user, void *buf)
{
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "pdc_free (user = %ld, buf = 0x%lx)\n", user,
- (long) buf);
+ gdb_printf (gdb_stdlog,
+ "pdc_free (user = %ld, buf = 0x%lx)\n", user,
+ (long) buf);
xfree (buf);
return PDC_SUCCESS;
}
@@ -1227,8 +1227,8 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
pthdb_context_t ctx;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "fetch_regs_user_thread %lx\n", (long) pdtid);
+ gdb_printf (gdb_stdlog,
+ "fetch_regs_user_thread %lx\n", (long) pdtid);
status = pthdb_pthread_context (pd_session, pdtid, &ctx);
if (status != PTHDB_SUCCESS)
error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"),
@@ -1286,9 +1286,9 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
int i;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "fetch_regs_kernel_thread tid=%lx regno=%d arch64=%d\n",
- (long) tid, regno, arch64);
+ gdb_printf (gdb_stdlog,
+ "fetch_regs_kernel_thread tid=%lx regno=%d arch64=%d\n",
+ (long) tid, regno, arch64);
/* General-purpose registers. */
if (regno == -1
@@ -1509,8 +1509,8 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
uint64_t int64;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "store_regs_user_thread %lx\n", (long) pdtid);
+ gdb_printf (gdb_stdlog,
+ "store_regs_user_thread %lx\n", (long) pdtid);
/* Retrieve the thread's current context for its non-register
values. */
@@ -1600,9 +1600,9 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
struct ptsprs sprs32;
if (debug_aix_thread)
- fprintf_unfiltered (gdb_stdlog,
- "store_regs_kernel_thread tid=%lx regno=%d\n",
- (long) tid, regno);
+ gdb_printf (gdb_stdlog,
+ "store_regs_kernel_thread tid=%lx regno=%d\n",
+ (long) tid, regno);
/* General-purpose registers. */
if (regno == -1
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d0df72be356..7f3af216675 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1102,7 +1102,7 @@ enclosing function for address %s"), paddress (gdbarch, orig_pc));
if (!blurb_printed)
{
- printf_filtered (_("\
+ gdb_printf (_("\
This warning occurs if you are debugging a function without any symbols\n\
(for example, in a stripped executable). In that case, you may wish to\n\
increase the size of the search with the `set heuristic-fence-post' command.\n\
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 2416204310f..b61428d0e84 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1496,10 +1496,10 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
if (syscall_gdb == gdb_sys_no_syscall)
{
- fprintf_unfiltered (gdb_stderr,
- _("Process record and replay target doesn't "
- "support syscall number %s\n"),
- pulongest (syscall_native));
+ gdb_printf (gdb_stderr,
+ _("Process record and replay target doesn't "
+ "support syscall number %s\n"),
+ pulongest (syscall_native));
return -1;
}
else
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 8d6f58c9c18..c16eb4651f3 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -293,7 +293,7 @@ void
annotate_error_begin (void)
{
if (annotation_level > 1)
- fprintf_unfiltered (gdb_stderr, "\n\032\032error-begin\n");
+ gdb_printf (gdb_stderr, "\n\032\032error-begin\n");
}
void
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 297f83b8650..d6da2886c49 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -435,14 +435,14 @@ arc_insn_get_branch_target (const struct arc_instruction &insn)
/* JLI and EI depend on optional AUX registers. Not supported right now. */
else if (insn.insn_class == JLI)
{
- fprintf_unfiltered (gdb_stderr,
- "JLI_S instruction is not supported by the GDB.");
+ gdb_printf (gdb_stderr,
+ "JLI_S instruction is not supported by the GDB.");
return 0;
}
else if (insn.insn_class == EI)
{
- fprintf_unfiltered (gdb_stderr,
- "EI_S instruction is not supported by the GDB.");
+ gdb_printf (gdb_stderr,
+ "EI_S instruction is not supported by the GDB.");
return 0;
}
/* LEAVE_S: PC = BLINK. */
@@ -2450,16 +2450,16 @@ arc_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
{
arc_gdbarch_tdep *tdep = (arc_gdbarch_tdep *) gdbarch_tdep (gdbarch);
- fprintf_filtered (file, "arc_dump_tdep: jb_pc = %i\n", tdep->jb_pc);
+ gdb_printf (file, "arc_dump_tdep: jb_pc = %i\n", tdep->jb_pc);
- fprintf_filtered (file, "arc_dump_tdep: is_sigtramp = <%s>\n",
- host_address_to_string (tdep->is_sigtramp));
- fprintf_filtered (file, "arc_dump_tdep: sigcontext_addr = <%s>\n",
- host_address_to_string (tdep->sigcontext_addr));
- fprintf_filtered (file, "arc_dump_tdep: sc_reg_offset = <%s>\n",
- host_address_to_string (tdep->sc_reg_offset));
- fprintf_filtered (file, "arc_dump_tdep: sc_num_regs = %d\n",
- tdep->sc_num_regs);
+ gdb_printf (file, "arc_dump_tdep: is_sigtramp = <%s>\n",
+ host_address_to_string (tdep->is_sigtramp));
+ gdb_printf (file, "arc_dump_tdep: sigcontext_addr = <%s>\n",
+ host_address_to_string (tdep->sigcontext_addr));
+ gdb_printf (file, "arc_dump_tdep: sc_reg_offset = <%s>\n",
+ host_address_to_string (tdep->sc_reg_offset));
+ gdb_printf (file, "arc_dump_tdep: sc_num_regs = %d\n",
+ tdep->sc_num_regs);
}
/* This command accepts single argument - address of instruction to
diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h
index 0a8d1dc5646..ceca003204f 100644
--- a/gdb/arc-tdep.h
+++ b/gdb/arc-tdep.h
@@ -110,7 +110,7 @@ enum arc_regnum
/* Special value for register offset arrays. */
#define ARC_OFFSET_NO_REGISTER (-1)
-#define arc_print(fmt, args...) fprintf_unfiltered (gdb_stdlog, fmt, ##args)
+#define arc_print(fmt, args...) gdb_printf (gdb_stdlog, fmt, ##args)
extern bool arc_debug;
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 3ee978a0249..ff946ee3767 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -375,18 +375,18 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
{
if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG)
- fprintf_filtered (file, _("The target endianness is set automatically "
- "(currently big endian).\n"));
+ gdb_printf (file, _("The target endianness is set automatically "
+ "(currently big endian).\n"));
else
- fprintf_filtered (file, _("The target endianness is set automatically "
- "(currently little endian).\n"));
+ gdb_printf (file, _("The target endianness is set automatically "
+ "(currently little endian).\n"));
else
if (target_byte_order_user == BFD_ENDIAN_BIG)
- fprintf_filtered (file,
- _("The target is set to big endian.\n"));
+ gdb_printf (file,
+ _("The target is set to big endian.\n"));
else
- fprintf_filtered (file,
- _("The target is set to little endian.\n"));
+ gdb_printf (file,
+ _("The target is set to little endian.\n"));
}
static void
@@ -405,8 +405,8 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
{
info.byte_order = BFD_ENDIAN_LITTLE;
if (! gdbarch_update_p (info))
- fprintf_unfiltered (gdb_stderr,
- _("Little endian target not supported by GDB\n"));
+ gdb_printf (gdb_stderr,
+ _("Little endian target not supported by GDB\n"));
else
target_byte_order_user = BFD_ENDIAN_LITTLE;
}
@@ -414,8 +414,8 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
{
info.byte_order = BFD_ENDIAN_BIG;
if (! gdbarch_update_p (info))
- fprintf_unfiltered (gdb_stderr,
- _("Big endian target not supported by GDB\n"));
+ gdb_printf (gdb_stderr,
+ _("Big endian target not supported by GDB\n"));
else
target_byte_order_user = BFD_ENDIAN_BIG;
}
@@ -535,12 +535,12 @@ show_architecture (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
if (target_architecture_user == NULL)
- fprintf_filtered (file, _("The target architecture is set to "
- "\"auto\" (currently \"%s\").\n"),
- gdbarch_bfd_arch_info (get_current_arch ())->printable_name);
+ gdb_printf (file, _("The target architecture is set to "
+ "\"auto\" (currently \"%s\").\n"),
+ gdbarch_bfd_arch_info (get_current_arch ())->printable_name);
else
- fprintf_filtered (file, _("The target architecture is set to \"%s\".\n"),
- set_architecture_string);
+ gdb_printf (file, _("The target architecture is set to \"%s\".\n"),
+ set_architecture_string);
}
@@ -569,9 +569,9 @@ set_architecture (const char *ignore_args,
if (gdbarch_update_p (info))
target_architecture_user = info.bfd_arch_info;
else
- fprintf_unfiltered (gdb_stderr,
- _("Architecture `%s' not recognized.\n"),
- set_architecture_string);
+ gdb_printf (gdb_stderr,
+ _("Architecture `%s' not recognized.\n"),
+ set_architecture_string);
}
show_architecture (gdb_stdout, from_tty, NULL, NULL);
}
@@ -599,8 +599,8 @@ gdbarch_update_p (struct gdbarch_info info)
if (new_gdbarch == NULL)
{
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
- "Architecture not found\n");
+ gdb_printf (gdb_stdlog, "gdbarch_update_p: "
+ "Architecture not found\n");
return 0;
}
@@ -609,19 +609,19 @@ gdbarch_update_p (struct gdbarch_info info)
if (new_gdbarch == target_gdbarch ())
{
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
- "Architecture %s (%s) unchanged\n",
- host_address_to_string (new_gdbarch),
- gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
+ gdb_printf (gdb_stdlog, "gdbarch_update_p: "
+ "Architecture %s (%s) unchanged\n",
+ host_address_to_string (new_gdbarch),
+ gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
return 1;
}
/* It's a new architecture, swap it in. */
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
- "New architecture %s (%s) selected\n",
- host_address_to_string (new_gdbarch),
- gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
+ gdb_printf (gdb_stdlog, "gdbarch_update_p: "
+ "New architecture %s (%s) selected\n",
+ host_address_to_string (new_gdbarch),
+ gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
set_target_gdbarch (new_gdbarch);
return 1;
@@ -1106,7 +1106,7 @@ static void
show_gdbarch_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
+ gdb_printf (file, _("Architecture debugging is %s.\n"), value);
}
static const char *
@@ -1202,7 +1202,7 @@ struct gdbarch_tdep *
gdbarch_tdep (struct gdbarch *gdbarch)
{
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
+ gdb_printf (gdb_stdlog, "gdbarch_tdep called\n");
return gdbarch->tdep;
}
@@ -1385,9 +1385,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
}
/* log it */
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
- bfd_arch_info->printable_name,
- host_address_to_string (init));
+ gdb_printf (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
+ bfd_arch_info->printable_name,
+ host_address_to_string (init));
/* Append it */
(*curr) = XNEW (struct gdbarch_registration);
(*curr)->bfd_architecture = bfd_architecture;
@@ -1446,23 +1446,23 @@ gdbarch_find_by_info (struct gdbarch_info info)
if (gdbarch_debug)
{
- fprintf_unfiltered (gdb_stdlog,
- "gdbarch_find_by_info: info.bfd_arch_info %s\n",
- (info.bfd_arch_info != NULL
- ? info.bfd_arch_info->printable_name
- : "(null)"));
- fprintf_unfiltered (gdb_stdlog,
- "gdbarch_find_by_info: info.byte_order %d (%s)\n",
- info.byte_order,
- (info.byte_order == BFD_ENDIAN_BIG ? "big"
- : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
- : "default"));
- fprintf_unfiltered (gdb_stdlog,
- "gdbarch_find_by_info: info.osabi %d (%s)\n",
- info.osabi, gdbarch_osabi_name (info.osabi));
- fprintf_unfiltered (gdb_stdlog,
- "gdbarch_find_by_info: info.abfd %s\n",
- host_address_to_string (info.abfd));
+ gdb_printf (gdb_stdlog,
+ "gdbarch_find_by_info: info.bfd_arch_info %s\n",
+ (info.bfd_arch_info != NULL
+ ? info.bfd_arch_info->printable_name
+ : "(null)"));
+ gdb_printf (gdb_stdlog,
+ "gdbarch_find_by_info: info.byte_order %d (%s)\n",
+ info.byte_order,
+ (info.byte_order == BFD_ENDIAN_BIG ? "big"
+ : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
+ : "default"));
+ gdb_printf (gdb_stdlog,
+ "gdbarch_find_by_info: info.osabi %d (%s)\n",
+ info.osabi, gdbarch_osabi_name (info.osabi));
+ gdb_printf (gdb_stdlog,
+ "gdbarch_find_by_info: info.abfd %s\n",
+ host_address_to_string (info.abfd));
}
/* Find the tdep code that knows about this architecture. */
@@ -1474,8 +1474,8 @@ gdbarch_find_by_info (struct gdbarch_info info)
if (rego == NULL)
{
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
- "No matching architecture\n");
+ gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
+ "No matching architecture\n");
return 0;
}
@@ -1487,8 +1487,8 @@ gdbarch_find_by_info (struct gdbarch_info info)
if (new_gdbarch == NULL)
{
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
- "Target rejected architecture\n");
+ gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
+ "Target rejected architecture\n");
return NULL;
}
@@ -1500,10 +1500,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
struct gdbarch_list **list;
struct gdbarch_list *self;
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
- "Previous architecture %s (%s) selected\n",
- host_address_to_string (new_gdbarch),
- new_gdbarch->bfd_arch_info->printable_name);
+ gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
+ "Previous architecture %s (%s) selected\n",
+ host_address_to_string (new_gdbarch),
+ new_gdbarch->bfd_arch_info->printable_name);
/* Find the existing arch in the list. */
for (list = ®o->arches;
(*list) != NULL && (*list)->gdbarch != new_gdbarch;
@@ -1522,10 +1522,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
/* It's a new architecture. */
if (gdbarch_debug)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
- "New architecture %s (%s) selected\n",
- host_address_to_string (new_gdbarch),
- new_gdbarch->bfd_arch_info->printable_name);
+ gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
+ "New architecture %s (%s) selected\n",
+ host_address_to_string (new_gdbarch),
+ new_gdbarch->bfd_arch_info->printable_name);
/* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 6aac016afb9..c8e882ab096 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1650,10 +1650,10 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
if (syscall_gdb == gdb_sys_no_syscall)
{
- fprintf_unfiltered (gdb_stderr,
- _("Process record and replay target doesn't "
- "support syscall number %s\n"),
- plongest (svc_number));
+ gdb_printf (gdb_stderr,
+ _("Process record and replay target doesn't "
+ "support syscall number %s\n"),
+ plongest (svc_number));
return -1;
}
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index a87affe17a8..4d0f3492410 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -4038,9 +4038,9 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
type = (status >> 24) & 127;
if (status & (1 << 31))
- fprintf_filtered (file, _("Hardware FPU type %d\n"), type);
+ gdb_printf (file, _("Hardware FPU type %d\n"), type);
else
- fprintf_filtered (file, _("Software FPU type %d\n"), type);
+ gdb_printf (file, _("Software FPU type %d\n"), type);
/* i18n: [floating point unit] mask */
gdb_puts (_("mask: "), file);
print_fpu_flags (file, status >> 16);
@@ -8551,13 +8551,13 @@ show_fp_model (struct ui_file *file, int from_tty,
if (arm_fp_model == ARM_FLOAT_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm)
- fprintf_filtered (file, _("\
+ gdb_printf (file, _("\
The current ARM floating point model is \"auto\" (currently \"%s\").\n"),
- fp_model_strings[tdep->fp_model]);
+ fp_model_strings[tdep->fp_model]);
else
- fprintf_filtered (file, _("\
+ gdb_printf (file, _("\
The current ARM floating point model is \"%s\".\n"),
- fp_model_strings[arm_fp_model]);
+ fp_model_strings[arm_fp_model]);
}
static void
@@ -8589,32 +8589,32 @@ arm_show_abi (struct ui_file *file, int from_tty,
if (arm_abi_global == ARM_ABI_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm)
- fprintf_filtered (file, _("\
+ gdb_printf (file, _("\
The current ARM ABI is \"auto\" (currently \"%s\").\n"),
- arm_abi_strings[tdep->arm_abi]);
+ arm_abi_strings[tdep->arm_abi]);
else
- fprintf_filtered (file, _("The current ARM ABI is \"%s\".\n"),
- arm_abi_string);
+ gdb_printf (file, _("The current ARM ABI is \"%s\".\n"),
+ arm_abi_string);
}
static void
arm_show_fallback_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file,
- _("The current execution mode assumed "
- "(when symbols are unavailable) is \"%s\".\n"),
- arm_fallback_mode_string);
+ gdb_printf (file,
+ _("The current execution mode assumed "
+ "(when symbols are unavailable) is \"%s\".\n"),
+ arm_fallback_mode_string);
}
static void
arm_show_force_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file,
- _("The current execution mode assumed "
- "(even when symbols are available) is \"%s\".\n"),
- arm_force_mode_string);
+ gdb_printf (file,
+ _("The current execution mode assumed "
+ "(even when symbols are available) is \"%s\".\n"),
+ arm_force_mode_string);
}
/* If the user changes the register disassembly style used for info
@@ -8649,7 +8649,7 @@ show_disassembly_style_sfunc (struct ui_file *file, int from_tty,
len = strcspn (style, ",");
}
- fprintf_filtered (file, "The disassembly style is \"%.*s\".\n", len, style);
+ gdb_printf (file, "The disassembly style is \"%.*s\".\n", len, style);
}
\f
/* Return the ARM register name corresponding to register I. */
@@ -9746,38 +9746,38 @@ arm_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
if (tdep == NULL)
return;
- fprintf_filtered (file, _("arm_dump_tdep: fp_model = %i\n"),
- (int) tdep->fp_model);
- fprintf_filtered (file, _("arm_dump_tdep: have_fpa_registers = %i\n"),
- (int) tdep->have_fpa_registers);
- fprintf_filtered (file, _("arm_dump_tdep: have_wmmx_registers = %i\n"),
- (int) tdep->have_wmmx_registers);
- fprintf_filtered (file, _("arm_dump_tdep: vfp_register_count = %i\n"),
- (int) tdep->vfp_register_count);
- fprintf_filtered (file, _("arm_dump_tdep: have_s_pseudos = %s\n"),
- tdep->have_s_pseudos? "true" : "false");
- fprintf_filtered (file, _("arm_dump_tdep: s_pseudo_base = %i\n"),
- (int) tdep->s_pseudo_base);
- fprintf_filtered (file, _("arm_dump_tdep: s_pseudo_count = %i\n"),
- (int) tdep->s_pseudo_count);
- fprintf_filtered (file, _("arm_dump_tdep: have_q_pseudos = %s\n"),
- tdep->have_q_pseudos? "true" : "false");
- fprintf_filtered (file, _("arm_dump_tdep: q_pseudo_base = %i\n"),
- (int) tdep->q_pseudo_base);
- fprintf_filtered (file, _("arm_dump_tdep: q_pseudo_count = %i\n"),
- (int) tdep->q_pseudo_count);
- fprintf_filtered (file, _("arm_dump_tdep: have_neon = %i\n"),
- (int) tdep->have_neon);
- fprintf_filtered (file, _("arm_dump_tdep: have_mve = %s\n"),
- tdep->have_mve? "yes" : "no");
- fprintf_filtered (file, _("arm_dump_tdep: mve_vpr_regnum = %i\n"),
- tdep->mve_vpr_regnum);
- fprintf_filtered (file, _("arm_dump_tdep: mve_pseudo_base = %i\n"),
- tdep->mve_pseudo_base);
- fprintf_filtered (file, _("arm_dump_tdep: mve_pseudo_count = %i\n"),
- tdep->mve_pseudo_count);
- fprintf_filtered (file, _("arm_dump_tdep: Lowest pc = 0x%lx\n"),
- (unsigned long) tdep->lowest_pc);
+ gdb_printf (file, _("arm_dump_tdep: fp_model = %i\n"),
+ (int) tdep->fp_model);
+ gdb_printf (file, _("arm_dump_tdep: have_fpa_registers = %i\n"),
+ (int) tdep->have_fpa_registers);
+ gdb_printf (file, _("arm_dump_tdep: have_wmmx_registers = %i\n"),
+ (int) tdep->have_wmmx_registers);
+ gdb_printf (file, _("arm_dump_tdep: vfp_register_count = %i\n"),
+ (int) tdep->vfp_register_count);
+ gdb_printf (file, _("arm_dump_tdep: have_s_pseudos = %s\n"),
+ tdep->have_s_pseudos? "true" : "false");
+ gdb_printf (file, _("arm_dump_tdep: s_pseudo_base = %i\n"),
+ (int) tdep->s_pseudo_base);
+ gdb_printf (file, _("arm_dump_tdep: s_pseudo_count = %i\n"),
+ (int) tdep->s_pseudo_count);
+ gdb_printf (file, _("arm_dump_tdep: have_q_pseudos = %s\n"),
+ tdep->have_q_pseudos? "true" : "false");
+ gdb_printf (file, _("arm_dump_tdep: q_pseudo_base = %i\n"),
+ (int) tdep->q_pseudo_base);
+ gdb_printf (file, _("arm_dump_tdep: q_pseudo_count = %i\n"),
+ (int) tdep->q_pseudo_count);
+ gdb_printf (file, _("arm_dump_tdep: have_neon = %i\n"),
+ (int) tdep->have_neon);
+ gdb_printf (file, _("arm_dump_tdep: have_mve = %s\n"),
+ tdep->have_mve? "yes" : "no");
+ gdb_printf (file, _("arm_dump_tdep: mve_vpr_regnum = %i\n"),
+ tdep->mve_vpr_regnum);
+ gdb_printf (file, _("arm_dump_tdep: mve_pseudo_base = %i\n"),
+ tdep->mve_pseudo_base);
+ gdb_printf (file, _("arm_dump_tdep: mve_pseudo_count = %i\n"),
+ tdep->mve_pseudo_count);
+ gdb_printf (file, _("arm_dump_tdep: Lowest pc = 0x%lx\n"),
+ (unsigned long) tdep->lowest_pc);
}
#if GDB_SELF_TEST
@@ -11359,10 +11359,10 @@ arm_record_b_bl (insn_decode_record *arm_insn_r)
static int
arm_record_unsupported_insn (insn_decode_record *arm_insn_r)
{
- fprintf_unfiltered (gdb_stderr,
- _("Process record does not support instruction "
- "0x%0x at address %s.\n"),arm_insn_r->arm_insn,
- paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support instruction "
+ "0x%0x at address %s.\n"),arm_insn_r->arm_insn,
+ paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr));
return -1;
}
@@ -11948,7 +11948,7 @@ arm_record_coproc_data_proc (insn_decode_record *arm_insn_r)
}
else
{
- fprintf_unfiltered (gdb_stderr, _("no syscall record support\n"));
+ gdb_printf (gdb_stderr, _("no syscall record support\n"));
return -1;
}
}
@@ -12380,12 +12380,12 @@ thumb_record_misc (insn_decode_record *thumb_insn_r)
record_buf[1] = ARM_LR_REGNUM;
thumb_insn_r->reg_rec_count = 2;
/* We need to save SPSR value, which is not yet done. */
- fprintf_unfiltered (gdb_stderr,
- _("Process record does not support instruction "
- "0x%0x at address %s.\n"),
- thumb_insn_r->arm_insn,
- paddress (thumb_insn_r->gdbarch,
- thumb_insn_r->this_addr));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support instruction "
+ "0x%0x at address %s.\n"),
+ thumb_insn_r->arm_insn,
+ paddress (thumb_insn_r->gdbarch,
+ thumb_insn_r->this_addr));
return -1;
case 0xf:
@@ -12473,7 +12473,7 @@ thumb_record_ldm_stm_swi (insn_decode_record *thumb_insn_r)
}
else
{
- fprintf_unfiltered (gdb_stderr, _("no syscall record support\n"));
+ gdb_printf (gdb_stderr, _("no syscall record support\n"));
return -1;
}
}
@@ -13384,11 +13384,11 @@ decode_insn (abstract_memory_reader &reader, insn_decode_record *arm_record,
{
if (record_debug)
{
- fprintf_unfiltered (gdb_stdlog,
- _("Process record: error reading memory at "
- "addr %s len = %d.\n"),
- paddress (arm_record->gdbarch,
- arm_record->this_addr), insn_size);
+ gdb_printf (gdb_stdlog,
+ _("Process record: error reading memory at "
+ "addr %s len = %d.\n"),
+ paddress (arm_record->gdbarch,
+ arm_record->this_addr), insn_size);
}
return -1;
}
@@ -13643,9 +13643,9 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
if (record_debug > 1)
{
- fprintf_unfiltered (gdb_stdlog, "Process record: arm_process_record "
- "addr = %s\n",
- paddress (gdbarch, arm_record.this_addr));
+ gdb_printf (gdb_stdlog, "Process record: arm_process_record "
+ "addr = %s\n",
+ paddress (gdbarch, arm_record.this_addr));
}
instruction_reader reader;
@@ -13653,11 +13653,11 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (record_debug)
{
- fprintf_unfiltered (gdb_stdlog,
- _("Process record: error reading memory at "
- "addr %s len = %d.\n"),
- paddress (arm_record.gdbarch,
- arm_record.this_addr), 2);
+ gdb_printf (gdb_stdlog,
+ _("Process record: error reading memory at "
+ "addr %s len = %d.\n"),
+ paddress (arm_record.gdbarch,
+ arm_record.this_addr), 2);
}
return -1;
}
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 5f530d080c3..057104d97b0 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -74,9 +74,9 @@ static void
show_debug_auto_load (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Debugging output for files "
- "of 'set auto-load ...' is %s.\n"),
- value);
+ gdb_printf (file, _("Debugging output for files "
+ "of 'set auto-load ...' is %s.\n"),
+ value);
}
/* User-settable option to enable/disable auto-loading of GDB_AUTO_FILE_NAME
@@ -92,9 +92,9 @@ static void
show_auto_load_gdb_scripts (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Auto-loading of canned sequences of commands "
- "scripts is %s.\n"),
- value);
+ gdb_printf (file, _("Auto-loading of canned sequences of commands "
+ "scripts is %s.\n"),
+ value);
}
/* See auto-load.h. */
@@ -132,9 +132,9 @@ static void
show_auto_load_local_gdbinit (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Auto-loading of .gdbinit script from current "
- "directory is %s.\n"),
- value);
+ gdb_printf (file, _("Auto-loading of .gdbinit script from current "
+ "directory is %s.\n"),
+ value);
}
/* Directory list from which to load auto-loaded scripts. It is not checked
@@ -158,9 +158,9 @@ static void
show_auto_load_dir (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("List of directories from which to load "
- "auto-loaded scripts is %s.\n"),
- value);
+ gdb_printf (file, _("List of directories from which to load "
+ "auto-loaded scripts is %s.\n"),
+ value);
}
/* Directory list safe to hold auto-loaded files. It is not checked for
@@ -275,12 +275,12 @@ show_auto_load_safe_path (struct ui_file *file, int from_tty,
for (cs = value; *cs && (*cs == DIRNAME_SEPARATOR || IS_DIR_SEPARATOR (*cs));
cs++);
if (*cs == 0)
- fprintf_filtered (file, _("Auto-load files are safe to load from any "
- "directory.\n"));
+ gdb_printf (file, _("Auto-load files are safe to load from any "
+ "directory.\n"));
else
- fprintf_filtered (file, _("List of directories from which it is safe to "
- "auto-load files is %s.\n"),
- value);
+ gdb_printf (file, _("List of directories from which it is safe to "
+ "auto-load files is %s.\n"),
+ value);
}
/* "add-auto-load-safe-path" command for the auto_load_safe_path configuration
@@ -476,7 +476,7 @@ file_is_auto_load_safe (const char *filename)
}
}
- printf_filtered (_("\
+ gdb_printf (_("\
To enable execution of this file add\n\
\tadd-auto-load-safe-path %s\n\
line to your configuration file \"%ps\".\n\
@@ -1357,15 +1357,15 @@ static void
info_auto_load_local_gdbinit (const char *args, int from_tty)
{
if (auto_load_local_gdbinit_pathname == NULL)
- printf_filtered (_("Local .gdbinit file was not found.\n"));
+ gdb_printf (_("Local .gdbinit file was not found.\n"));
else if (auto_load_local_gdbinit_loaded)
- printf_filtered (_("Local .gdbinit file \"%ps\" has been loaded.\n"),
- styled_string (file_name_style.style (),
- auto_load_local_gdbinit_pathname));
+ gdb_printf (_("Local .gdbinit file \"%ps\" has been loaded.\n"),
+ styled_string (file_name_style.style (),
+ auto_load_local_gdbinit_pathname));
else
- printf_filtered (_("Local .gdbinit file \"%ps\" has not been loaded.\n"),
- styled_string (file_name_style.style (),
- auto_load_local_gdbinit_pathname));
+ gdb_printf (_("Local .gdbinit file \"%ps\" has not been loaded.\n"),
+ styled_string (file_name_style.style (),
+ auto_load_local_gdbinit_pathname));
}
/* Print an "unsupported script" warning if it has not already been printed.
diff --git a/gdb/auxv.c b/gdb/auxv.c
index 36ef51f3aed..840db0257af 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -414,15 +414,15 @@ fprint_auxv_entry (struct ui_file *file, const char *name,
const char *description, enum auxv_format format,
CORE_ADDR type, CORE_ADDR val)
{
- fprintf_filtered (file, ("%-4s %-20s %-30s "),
- plongest (type), name, description);
+ gdb_printf (file, ("%-4s %-20s %-30s "),
+ plongest (type), name, description);
switch (format)
{
case AUXV_FORMAT_DEC:
- fprintf_filtered (file, ("%s\n"), plongest (val));
+ gdb_printf (file, ("%s\n"), plongest (val));
break;
case AUXV_FORMAT_HEX:
- fprintf_filtered (file, ("%s\n"), paddress (target_gdbarch (), val));
+ gdb_printf (file, ("%s\n"), paddress (target_gdbarch (), val));
break;
case AUXV_FORMAT_STR:
{
@@ -430,10 +430,10 @@ fprint_auxv_entry (struct ui_file *file, const char *name,
get_user_print_options (&opts);
if (opts.addressprint)
- fprintf_filtered (file, ("%s "), paddress (target_gdbarch (), val));
+ gdb_printf (file, ("%s "), paddress (target_gdbarch (), val));
val_print_string (builtin_type (target_gdbarch ())->builtin_char,
NULL, val, -1, file, &opts);
- fprintf_filtered (file, ("\n"));
+ gdb_printf (file, ("\n"));
}
break;
}
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 7f79ef94bdf..310c8cf9ca2 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -668,8 +668,8 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
if (num_pushes > AVR_MAX_PUSHES)
{
- fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"),
- num_pushes);
+ gdb_printf (gdb_stderr, _("Num pushes too large: %d\n"),
+ num_pushes);
num_pushes = 0;
}
@@ -1574,9 +1574,9 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (!buf)
{
- fprintf_unfiltered (gdb_stderr,
- _("ERR: info io_registers NOT supported "
- "by current target\n"));
+ gdb_printf (gdb_stderr,
+ _("ERR: info io_registers NOT supported "
+ "by current target\n"));
return;
}
@@ -1584,12 +1584,12 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (sscanf (bufstr, "%x", &nreg) != 1)
{
- fprintf_unfiltered (gdb_stderr,
- _("Error fetching number of io registers\n"));
+ gdb_printf (gdb_stderr,
+ _("Error fetching number of io registers\n"));
return;
}
- printf_filtered (_("Target has %u io registers:\n\n"), nreg);
+ gdb_printf (_("Target has %u io registers:\n\n"), nreg);
/* only fetch up to 8 registers at a time to keep the buffer small */
int step = 8;
@@ -1607,9 +1607,9 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (!buf)
{
- fprintf_unfiltered (gdb_stderr,
- _("ERR: error reading avr.io_reg:%x,%x\n"),
- i, j);
+ gdb_printf (gdb_stderr,
+ _("ERR: error reading avr.io_reg:%x,%x\n"),
+ i, j);
return;
}
@@ -1618,7 +1618,7 @@ avr_io_reg_read_command (const char *args, int from_tty)
{
if (sscanf (p, "%[^,],%x;", query, &val) == 2)
{
- printf_filtered ("[%02x] %-15s : %02x\n", k, query, val);
+ gdb_printf ("[%02x] %-15s : %02x\n", k, query, val);
while ((*p != ';') && (*p != '\0'))
p++;
p++; /* skip over ';' */
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index f829b32e015..c025aa214b4 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -365,11 +365,11 @@ ax_print (struct ui_file *f, struct agent_expr *x)
{
int i;
- fprintf_filtered (f, _("Scope: %s\n"), paddress (x->gdbarch, x->scope));
- fprintf_filtered (f, _("Reg mask:"));
+ gdb_printf (f, _("Scope: %s\n"), paddress (x->gdbarch, x->scope));
+ gdb_printf (f, _("Reg mask:"));
for (i = 0; i < x->reg_mask_len; ++i)
- fprintf_filtered (f, _(" %02x"), x->reg_mask[i]);
- fprintf_filtered (f, _("\n"));
+ gdb_printf (f, _(" %02x"), x->reg_mask[i]);
+ gdb_printf (f, _("\n"));
/* Check the size of the name array against the number of entries in
the enum, to catch additions that people didn't sync. */
@@ -384,18 +384,18 @@ ax_print (struct ui_file *f, struct agent_expr *x)
if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
|| !aop_map[op].name)
{
- fprintf_filtered (f, _("%3d <bad opcode %02x>\n"), i, op);
+ gdb_printf (f, _("%3d <bad opcode %02x>\n"), i, op);
i++;
continue;
}
if (i + 1 + aop_map[op].op_size > x->len)
{
- fprintf_filtered (f, _("%3d <incomplete opcode %s>\n"),
- i, aop_map[op].name);
+ gdb_printf (f, _("%3d <incomplete opcode %s>\n"),
+ i, aop_map[op].name);
break;
}
- fprintf_filtered (f, "%3d %s", i, aop_map[op].name);
+ gdb_printf (f, "%3d %s", i, aop_map[op].name);
if (aop_map[op].op_size > 0)
{
gdb_puts (" ", f);
@@ -412,11 +412,11 @@ ax_print (struct ui_file *f, struct agent_expr *x)
nargs = x->buf[i++];
slen = x->buf[i++];
slen = slen * 256 + x->buf[i++];
- fprintf_filtered (f, _(" \"%s\", %d args"),
- &(x->buf[i]), nargs);
+ gdb_printf (f, _(" \"%s\", %d args"),
+ &(x->buf[i]), nargs);
i += slen - 1;
}
- fprintf_filtered (f, "\n");
+ gdb_printf (f, "\n");
i += 1 + aop_map[op].op_size;
}
}
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 6d0741b59d0..80ba1f6b6ec 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -245,15 +245,15 @@ print_percentage (int portion, int total)
{
if (total == 0)
/* i18n: Like "Percentage of duplicates, by count: (not applicable)". */
- printf_filtered (_("(not applicable)\n"));
+ gdb_printf (_("(not applicable)\n"));
else
- printf_filtered ("%3d%%\n", (int) (portion * 100.0 / total));
+ gdb_printf ("%3d%%\n", (int) (portion * 100.0 / total));
}
/* Print statistics on BCACHE's memory usage and efficacity at
eliminating duplication. NAME should describe the kind of data
- BCACHE holds. Statistics are printed using `printf_filtered' and
+ BCACHE holds. Statistics are printed using `gdb_printf' and
its ilk. */
void
bcache::print_statistics (const char *type)
@@ -325,59 +325,59 @@ bcache::print_statistics (const char *type)
xfree (entry_size);
}
- printf_filtered (_(" M_Cached '%s' statistics:\n"), type);
- printf_filtered (_(" Total object count: %ld\n"), m_total_count);
- printf_filtered (_(" Unique object count: %lu\n"), m_unique_count);
- printf_filtered (_(" Percentage of duplicates, by count: "));
+ gdb_printf (_(" M_Cached '%s' statistics:\n"), type);
+ gdb_printf (_(" Total object count: %ld\n"), m_total_count);
+ gdb_printf (_(" Unique object count: %lu\n"), m_unique_count);
+ gdb_printf (_(" Percentage of duplicates, by count: "));
print_percentage (m_total_count - m_unique_count, m_total_count);
- printf_filtered ("\n");
+ gdb_printf ("\n");
- printf_filtered (_(" Total object size: %ld\n"), m_total_size);
- printf_filtered (_(" Unique object size: %ld\n"), m_unique_size);
- printf_filtered (_(" Percentage of duplicates, by size: "));
+ gdb_printf (_(" Total object size: %ld\n"), m_total_size);
+ gdb_printf (_(" Unique object size: %ld\n"), m_unique_size);
+ gdb_printf (_(" Percentage of duplicates, by size: "));
print_percentage (m_total_size - m_unique_size, m_total_size);
- printf_filtered ("\n");
+ gdb_printf ("\n");
- printf_filtered (_(" Max entry size: %d\n"), max_entry_size);
- printf_filtered (_(" Average entry size: "));
+ gdb_printf (_(" Max entry size: %d\n"), max_entry_size);
+ gdb_printf (_(" Average entry size: "));
if (m_unique_count > 0)
- printf_filtered ("%ld\n", m_unique_size / m_unique_count);
+ gdb_printf ("%ld\n", m_unique_size / m_unique_count);
else
/* i18n: "Average entry size: (not applicable)". */
- printf_filtered (_("(not applicable)\n"));
- printf_filtered (_(" Median entry size: %d\n"), median_entry_size);
- printf_filtered ("\n");
+ gdb_printf (_("(not applicable)\n"));
+ gdb_printf (_(" Median entry size: %d\n"), median_entry_size);
+ gdb_printf ("\n");
- printf_filtered (_(" \
+ gdb_printf (_(" \
Total memory used by bcache, including overhead: %ld\n"),
- m_structure_size);
- printf_filtered (_(" Percentage memory overhead: "));
+ m_structure_size);
+ gdb_printf (_(" Percentage memory overhead: "));
print_percentage (m_structure_size - m_unique_size, m_unique_size);
- printf_filtered (_(" Net memory savings: "));
+ gdb_printf (_(" Net memory savings: "));
print_percentage (m_total_size - m_structure_size, m_total_size);
- printf_filtered ("\n");
-
- printf_filtered (_(" Hash table size: %3d\n"),
- m_num_buckets);
- printf_filtered (_(" Hash table expands: %lu\n"),
- m_expand_count);
- printf_filtered (_(" Hash table hashes: %lu\n"),
- m_total_count + m_expand_hash_count);
- printf_filtered (_(" Half hash misses: [...]
[diff truncated at 100000 bytes]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-29 19:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 19:43 [binutils-gdb] Unify gdb printf functions Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).