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

@ -1489,10 +1489,10 @@ aarch64_linux_syscall_record (struct regcache *regcache,
if (syscall_gdb < 0) if (syscall_gdb < 0)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record and replay target doesn't " _("Process record and replay target doesn't "
"support syscall number %s\n"), "support syscall number %s\n"),
plongest (svc_number)); plongest (svc_number));
return -1; return -1;
} }

View file

@ -214,7 +214,7 @@ static void
show_aarch64_debug (struct ui_file *file, int from_tty, show_aarch64_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) 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 { namespace {
@ -3691,8 +3691,8 @@ aarch64_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
if (tdep == NULL) if (tdep == NULL)
return; return;
fprintf_filtered (file, _("aarch64_dump_tdep: Lowest pc = 0x%s"), gdb_printf (file, _("aarch64_dump_tdep: Lowest pc = 0x%s"),
paddress (gdbarch, tdep->lowest_pc)); paddress (gdbarch, tdep->lowest_pc));
} }
#if GDB_SELF_TEST #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); ret = aarch64_record_decode_insn_handler (&aarch64_record);
if (ret == AARCH64_RECORD_UNSUPPORTED) if (ret == AARCH64_RECORD_UNSUPPORTED)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record does not support instruction " _("Process record does not support instruction "
"0x%0x at address %s.\n"), "0x%0x at address %s.\n"),
aarch64_record.aarch64_insn, aarch64_record.aarch64_insn,
paddress (gdbarch, insn_addr)); paddress (gdbarch, insn_addr));
ret = -1; ret = -1;
} }

View file

@ -3485,7 +3485,7 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
{ {
struct type *type = sym->type (); struct type *type = sym->type ();
fprintf_filtered (stream, "%s", sym->print_name ()); gdb_printf (stream, "%s", sym->print_name ());
if (!print_signatures if (!print_signatures
|| type == NULL || type == NULL
|| type->code () != TYPE_CODE_FUNC) || type->code () != TYPE_CODE_FUNC)
@ -3495,20 +3495,20 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
{ {
int i; int i;
fprintf_filtered (stream, " ("); gdb_printf (stream, " (");
for (i = 0; i < type->num_fields (); ++i) for (i = 0; i < type->num_fields (); ++i)
{ {
if (i > 0) if (i > 0)
fprintf_filtered (stream, "; "); gdb_printf (stream, "; ");
ada_print_type (type->field (i).type (), NULL, stream, -1, 0, ada_print_type (type->field (i).type (), NULL, stream, -1, 0,
flags); flags);
} }
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
if (TYPE_TARGET_TYPE (type) != NULL if (TYPE_TARGET_TYPE (type) != NULL
&& TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) && 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); 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) if (select_mode == multiple_symbols_all && max_results > 1)
return nsyms; return nsyms;
printf_filtered (_("[0] cancel\n")); gdb_printf (_("[0] cancel\n"));
if (max_results > 1) if (max_results > 1)
printf_filtered (_("[1] all\n")); gdb_printf (_("[1] all\n"));
sort_choices (syms, nsyms); sort_choices (syms, nsyms);
@ -3650,14 +3650,14 @@ See set/show multiple-symbol."));
struct symtab_and_line sal = struct symtab_and_line sal =
find_function_start_sal (syms[i].symbol, 1); 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, ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options); &type_print_raw_options);
if (sal.symtab == NULL) if (sal.symtab == NULL)
printf_filtered (_(" at %p[<no source file available>%p]:%d\n"), gdb_printf (_(" at %p[<no source file available>%p]:%d\n"),
metadata_style.style ().ptr (), nullptr, sal.line); metadata_style.style ().ptr (), nullptr, sal.line);
else else
printf_filtered gdb_printf
(_(" at %ps:%d\n"), (_(" at %ps:%d\n"),
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
symtab_to_filename_for_display (sal.symtab)), symtab_to_filename_for_display (sal.symtab)),
@ -3677,37 +3677,37 @@ See set/show multiple-symbol."));
if (syms[i].symbol->line () != 0 && symtab != NULL) 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, ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options); &type_print_raw_options);
printf_filtered (_(" at %s:%d\n"), gdb_printf (_(" at %s:%d\n"),
symtab_to_filename_for_display (symtab), symtab_to_filename_for_display (symtab),
syms[i].symbol->line ()); syms[i].symbol->line ());
} }
else if (is_enumeral else if (is_enumeral
&& syms[i].symbol->type ()->name () != NULL) && 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, ada_print_type (syms[i].symbol->type (), NULL,
gdb_stdout, -1, 0, &type_print_raw_options); gdb_stdout, -1, 0, &type_print_raw_options);
printf_filtered (_("'(%s) (enumeral)\n"), gdb_printf (_("'(%s) (enumeral)\n"),
syms[i].symbol->print_name ()); syms[i].symbol->print_name ());
} }
else else
{ {
printf_filtered ("[%d] ", i + first_choice); gdb_printf ("[%d] ", i + first_choice);
ada_print_symbol_signature (gdb_stdout, syms[i].symbol, ada_print_symbol_signature (gdb_stdout, syms[i].symbol,
&type_print_raw_options); &type_print_raw_options);
if (symtab != NULL) if (symtab != NULL)
printf_filtered (is_enumeral gdb_printf (is_enumeral
? _(" in %s (enumeral)\n") ? _(" in %s (enumeral)\n")
: _(" at %s:?\n"), : _(" at %s:?\n"),
symtab_to_filename_for_display (symtab)); symtab_to_filename_for_display (symtab));
else else
printf_filtered (is_enumeral gdb_printf (is_enumeral
? _(" (enumeral)\n") ? _(" (enumeral)\n")
: _(" at ?\n")); : _(" at ?\n"));
} }
} }
} }
@ -3870,7 +3870,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
} }
else 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); user_select_syms (candidates.data (), candidates.size (), 1);
i = 0; i = 0;
} }
@ -4053,7 +4053,7 @@ ada_resolve_function (std::vector<struct block_symbol> &syms,
return -1; return -1;
else if (m > 1 && !parse_completion) 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); user_select_syms (syms.data (), m, 1);
return 0; return 0;
} }
@ -9466,7 +9466,7 @@ ada_aggregate_component::uses_objfile (struct objfile *objfile)
void void
ada_aggregate_component::dump (ui_file *stream, int depth) 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) for (const auto &item : m_components)
item->dump (stream, depth + 1); item->dump (stream, depth + 1);
} }
@ -9533,8 +9533,8 @@ ada_positional_component::uses_objfile (struct objfile *objfile)
void void
ada_positional_component::dump (ui_file *stream, int depth) ada_positional_component::dump (ui_file *stream, int depth)
{ {
fprintf_filtered (stream, _("%*sPositional, index = %d\n"), gdb_printf (stream, _("%*sPositional, index = %d\n"),
depth, "", m_index); depth, "", m_index);
m_op->dump (stream, depth + 1); m_op->dump (stream, depth + 1);
} }
@ -9568,7 +9568,7 @@ ada_discrete_range_association::uses_objfile (struct objfile *objfile)
void void
ada_discrete_range_association::dump (ui_file *stream, int depth) 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_low->dump (stream, depth + 1);
m_high->dump (stream, depth + 1); m_high->dump (stream, depth + 1);
} }
@ -9604,7 +9604,7 @@ ada_name_association::uses_objfile (struct objfile *objfile)
void void
ada_name_association::dump (ui_file *stream, int depth) 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); m_val->dump (stream, depth + 1);
} }
@ -9662,7 +9662,7 @@ ada_choices_component::uses_objfile (struct objfile *objfile)
void void
ada_choices_component::dump (ui_file *stream, int depth) 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); m_op->dump (stream, depth + 1);
for (const auto &item : m_assocs) for (const auto &item : m_assocs)
item->dump (stream, depth + 1); item->dump (stream, depth + 1);
@ -9691,7 +9691,7 @@ ada_others_component::uses_objfile (struct objfile *objfile)
void void
ada_others_component::dump (ui_file *stream, int depth) 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); m_op->dump (stream, depth + 1);
} }
@ -12460,21 +12460,21 @@ print_recreate_exception (struct breakpoint *b, struct ui_file *fp)
switch (c->m_kind) switch (c->m_kind)
{ {
case ada_catch_exception: case ada_catch_exception:
fprintf_filtered (fp, "catch exception"); gdb_printf (fp, "catch exception");
if (!c->excep_string.empty ()) if (!c->excep_string.empty ())
fprintf_filtered (fp, " %s", c->excep_string.c_str ()); gdb_printf (fp, " %s", c->excep_string.c_str ());
break; break;
case ada_catch_exception_unhandled: case ada_catch_exception_unhandled:
fprintf_filtered (fp, "catch exception unhandled"); gdb_printf (fp, "catch exception unhandled");
break; break;
case ada_catch_handlers: case ada_catch_handlers:
fprintf_filtered (fp, "catch handlers"); gdb_printf (fp, "catch handlers");
break; break;
case ada_catch_assert: case ada_catch_assert:
fprintf_filtered (fp, "catch assert"); gdb_printf (fp, "catch assert");
break; break;
default: default:
@ -13155,13 +13155,13 @@ info_exceptions_command (const char *regexp, int from_tty)
std::vector<ada_exc_info> exceptions = ada_exceptions_list (regexp); std::vector<ada_exc_info> exceptions = ada_exceptions_list (regexp);
if (regexp != NULL) if (regexp != NULL)
printf_filtered gdb_printf
(_("All Ada exceptions matching regular expression \"%s\":\n"), regexp); (_("All Ada exceptions matching regular expression \"%s\":\n"), regexp);
else else
printf_filtered (_("All defined Ada exceptions:\n")); gdb_printf (_("All defined Ada exceptions:\n"));
for (const ada_exc_info &info : exceptions) 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));
} }
@ -13392,7 +13392,7 @@ public:
struct value *index_value = val_atr (index_type, index); struct value *index_value = val_atr (index_type, index);
value_print (index_value, stream, options); value_print (index_value, stream, options);
fprintf_filtered (stream, " => "); gdb_printf (stream, " => ");
} }
/* Implement the "read_var_value" language_defn method for Ada. */ /* Implement the "read_var_value" language_defn method for Ada. */

View file

@ -1223,23 +1223,23 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
task_info = &data->task_list[taskno - 1]; task_info = &data->task_list[taskno - 1];
/* Print the Ada task ID. */ /* Print the Ada task ID. */
printf_filtered (_("Ada Task: %s\n"), gdb_printf (_("Ada Task: %s\n"),
paddress (target_gdbarch (), task_info->task_id)); paddress (target_gdbarch (), task_info->task_id));
/* Print the name of the task. */ /* Print the name of the task. */
if (task_info->name[0] != '\0') if (task_info->name[0] != '\0')
printf_filtered (_("Name: %s\n"), task_info->name); gdb_printf (_("Name: %s\n"), task_info->name);
else else
fprintf_styled (gdb_stdout, metadata_style.style (), _("<no name>\n")); fprintf_styled (gdb_stdout, metadata_style.style (), _("<no name>\n"));
/* Print the TID and LWP. */ /* Print the TID and LWP. */
printf_filtered (_("Thread: 0x%s\n"), phex_nz (task_info->ptid.tid (), gdb_printf (_("Thread: 0x%s\n"), phex_nz (task_info->ptid.tid (),
sizeof (ULONGEST))); sizeof (ULONGEST)));
printf_filtered (_("LWP: %#lx\n"), task_info->ptid.lwp ()); gdb_printf (_("LWP: %#lx\n"), task_info->ptid.lwp ());
/* If set, print the base CPU. */ /* If set, print the base CPU. */
if (task_info->base_cpu != 0) 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). */ /* Print who is the parent (if any). */
if (task_info->parent != 0) 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]; 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') if (parent->name[0] != '\0')
printf_filtered (" (%s)", parent->name); gdb_printf (" (%s)", parent->name);
printf_filtered ("\n"); gdb_printf ("\n");
} }
else else
printf_filtered (_("No parent\n")); gdb_printf (_("No parent\n"));
/* Print the base priority. */ /* 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. */ /* 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) if (task_info->caller_task)
{ {
target_taskno = get_task_number_from_id (task_info->caller_task, inf); target_taskno = get_task_number_from_id (task_info->caller_task, inf);
printf_filtered (_("State: Accepting rendezvous with %d"), gdb_printf (_("State: Accepting rendezvous with %d"),
target_taskno); target_taskno);
} }
else if (task_info->called_task) else if (task_info->called_task)
{ {
target_taskno = get_task_number_from_id (task_info->called_task, inf); target_taskno = get_task_number_from_id (task_info->called_task, inf);
printf_filtered (_("State: Waiting on task %d's entry"), gdb_printf (_("State: Waiting on task %d's entry"),
target_taskno); target_taskno);
} }
else else
printf_filtered (_("State: %s"), _(long_task_states[task_info->state])); gdb_printf (_("State: %s"), _(long_task_states[task_info->state]));
if (target_taskno) if (target_taskno)
{ {
ada_task_info *target_task_info = &data->task_list[target_taskno - 1]; ada_task_info *target_task_info = &data->task_list[target_taskno - 1];
if (target_task_info->name[0] != '\0') 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 ()); const int current_task = ada_get_task_number (inferior_thread ());
if (current_task == 0) if (current_task == 0)
printf_filtered (_("[Current task is unknown]\n")); gdb_printf (_("[Current task is unknown]\n"));
else else
{ {
struct ada_tasks_inferior_data *data struct ada_tasks_inferior_data *data
= get_ada_tasks_inferior_data (current_inferior ()); = get_ada_tasks_inferior_data (current_inferior ());
struct ada_task_info *task_info = &data->task_list[current_task - 1]; struct ada_task_info *task_info = &data->task_list[current_task - 1];
printf_filtered (_("[Current task is %s]\n"), gdb_printf (_("[Current task is %s]\n"),
task_to_str (current_task, task_info).c_str ()); 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); switch_to_thread (tp);
ada_find_printable_frame (get_selected_frame (NULL)); ada_find_printable_frame (get_selected_frame (NULL));
printf_filtered (_("[Switching to task %s]\n"), gdb_printf (_("[Switching to task %s]\n"),
task_to_str (taskno, task_info).c_str ()); task_to_str (taskno, task_info).c_str ());
print_stack_frame (get_selected_frame (NULL), print_stack_frame (get_selected_frame (NULL),
frame_relative_level (get_selected_frame (NULL)), frame_relative_level (get_selected_frame (NULL)),
SRC_AND_LOC, 1); SRC_AND_LOC, 1);

View file

@ -166,22 +166,22 @@ print_range (struct type *type, struct ui_file *stream,
access to an actual object, which is not available access to an actual object, which is not available
when the user is using the "ptype" command on a type. when the user is using the "ptype" command on a type.
Print the range as an unbounded range. */ Print the range as an unbounded range. */
fprintf_filtered (stream, "<>"); gdb_printf (stream, "<>");
got_error = 1; got_error = 1;
} }
if (!got_error) if (!got_error)
{ {
ada_print_scalar (type, lo, stream); ada_print_scalar (type, lo, stream);
fprintf_filtered (stream, " .. "); gdb_printf (stream, " .. ");
ada_print_scalar (type, hi, stream); ada_print_scalar (type, hi, stream);
} }
} }
break; break;
default: default:
fprintf_filtered (stream, "%.*s", gdb_printf (stream, "%.*s",
ada_name_prefix_len (type->name ()), ada_name_prefix_len (type->name ()),
type->name ()); type->name ());
break; break;
} }
} }
@ -228,7 +228,7 @@ print_range_bound (struct type *type, const char *bounds, int *n,
bound_len = pend - bound; bound_len = pend - bound;
*n += bound_len + 2; *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)) if (get_int_var_value (name_buf.c_str (), B))
ada_print_scalar (type, B, stream); ada_print_scalar (type, B, stream);
else else
fprintf_filtered (stream, "?"); gdb_printf (stream, "?");
} }
/* Print RAW_TYPE as a range type, using any bound information /* 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", print_dynamic_range_bound (base_type, name, prefix_len, "___L",
stream); stream);
fprintf_filtered (stream, " .. "); gdb_printf (stream, " .. ");
if (*subtype_info == 'U') if (*subtype_info == 'U')
print_range_bound (base_type, bounds_str, &n, stream); 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; int i;
LONGEST lastval; LONGEST lastval;
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
stream->wrap_here (1); stream->wrap_here (1);
lastval = 0; lastval = 0;
@ -324,19 +324,19 @@ print_enum_type (struct type *type, struct ui_file *stream)
{ {
QUIT; QUIT;
if (i) if (i)
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
stream->wrap_here (4); stream->wrap_here (4);
fputs_styled (ada_enum_name (type->field (i).name ()), fputs_styled (ada_enum_name (type->field (i).name ()),
variable_name_style.style (), stream); variable_name_style.style (), stream);
if (lastval != type->field (i).loc_enumval ()) if (lastval != type->field (i).loc_enumval ())
{ {
fprintf_filtered (stream, " => %s", gdb_printf (stream, " => %s",
plongest (type->field (i).loc_enumval ())); plongest (type->field (i).loc_enumval ()));
lastval = type->field (i).loc_enumval (); lastval = type->field (i).loc_enumval ();
} }
lastval += 1; lastval += 1;
} }
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
/* Print simple (constrained) array type TYPE on STREAM. LEVEL is the /* 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); type = ada_coerce_to_simple_array_type (type);
bitsize = 0; bitsize = 0;
fprintf_filtered (stream, "array ("); gdb_printf (stream, "array (");
if (type == NULL) 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)) arr_type = TYPE_TARGET_TYPE (arr_type))
{ {
if (arr_type != type) if (arr_type != type)
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
print_range (arr_type->index_type (), stream, print_range (arr_type->index_type (), stream,
0 /* bounds_prefered_p */); 0 /* bounds_prefered_p */);
if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0) 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)) k += 1, arr_type = TYPE_TARGET_TYPE (arr_type))
{ {
if (k > 0) if (k > 0)
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
print_range_type (range_desc_type->field (k).type (), print_range_type (range_desc_type->field (k).type (),
stream, 0 /* bounds_prefered_p */); stream, 0 /* bounds_prefered_p */);
if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0) 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; int i, i0;
for (i = i0 = ada_array_arity (type); i > 0; i -= 1) 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); elt_type = ada_array_element_type (type, n_indices);
fprintf_filtered (stream, ") of "); gdb_printf (stream, ") of ");
stream->wrap_here (0); stream->wrap_here (0);
ada_print_type (elt_type, "", stream, show == 0 ? 0 : show - 1, level + 1, ada_print_type (elt_type, "", stream, show == 0 ? 0 : show - 1, level + 1,
flags); 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 compilers have to describe their stride so that we can properly fetch
individual elements. Do not say the array is packed in this case. */ individual elements. Do not say the array is packed in this case. */
if (bitsize > 0 && !is_dynamic_type (elt_type)) 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 /* 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; goto Huh;
case '_': case '_':
case '\0': case '\0':
fprintf_filtered (stream, " =>"); gdb_printf (stream, " =>");
return 1; return 1;
case 'S': case 'S':
case 'R': case 'R':
case 'O': case 'O':
if (have_output) if (have_output)
fprintf_filtered (stream, " | "); gdb_printf (stream, " | ");
have_output = 1; have_output = 1;
break; 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)) || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
goto Huh; goto Huh;
ada_print_scalar (val_type, L, stream); ada_print_scalar (val_type, L, stream);
fprintf_filtered (stream, " .. "); gdb_printf (stream, " .. ");
ada_print_scalar (val_type, U, stream); ada_print_scalar (val_type, U, stream);
break; break;
} }
case 'O': case 'O':
fprintf_filtered (stream, "others"); gdb_printf (stream, "others");
p += 1; p += 1;
break; break;
} }
} }
Huh: Huh:
fprintf_filtered (stream, "? =>"); gdb_printf (stream, "? =>");
return 0; 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) 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_choices (var_type, i, stream, discr_type))
{ {
if (print_record_field_types (var_type->field (i).type (), if (print_record_field_types (var_type->field (i).type (),
outer_type, stream, show, level, outer_type, stream, show, level,
flags) flags)
<= 0) <= 0)
fprintf_filtered (stream, " null;"); gdb_printf (stream, " null;");
} }
else else
print_selected_record_field_types (var_type, outer_type, i, i, 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') if (*variant == '\0')
variant = "?"; 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, print_variant_clauses (type, field_num, outer_type, stream, show,
level + 4, flags); 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 /* 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 else
{ {
flds += 1; flds += 1;
fprintf_filtered (stream, "\n%*s", level + 4, ""); gdb_printf (stream, "\n%*s", level + 4, "");
ada_print_type (type->field (i).type (), ada_print_type (type->field (i).type (),
type->field (i).name (), type->field (i).name (),
stream, show - 1, level + 4, flags); 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, print_choices (struct type *discr_type, const variant &variant,
struct ui_file *stream, int level) struct ui_file *stream, int level)
{ {
fprintf_filtered (stream, "\n%*swhen ", level, ""); gdb_printf (stream, "\n%*swhen ", level, "");
if (variant.is_default ()) if (variant.is_default ())
fprintf_filtered (stream, "others"); gdb_printf (stream, "others");
else else
{ {
bool first = true; bool first = true;
for (const discriminant_range &range : variant.discriminants) for (const discriminant_range &range : variant.discriminants)
{ {
if (!first) if (!first)
fprintf_filtered (stream, " | "); gdb_printf (stream, " | ");
first = false; first = false;
ada_print_scalar (discr_type, range.low, stream); 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 /* 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 (); 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; int last_field = -1;
for (const variant &variant : part.variants) 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); print_choices (discr_type, variant, stream, level + 8);
if (variant.first_field == variant.last_field) if (variant.first_field == variant.last_field)
fprintf_filtered (stream, " null;"); gdb_printf (stream, " null;");
else else
{ {
print_record_field_types_dynamic (variant.parts, 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; 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. */ prevents a crash trying to print a NULL pointer. */
if (parent_name == NULL) if (parent_name == NULL)
parent_name = ada_type_name (parent_type); 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)) else if (parent_type == NULL && ada_is_tagged_type (type, 0))
fprintf_filtered (stream, "tagged record"); gdb_printf (stream, "tagged record");
else else
fprintf_filtered (stream, "record"); gdb_printf (stream, "record");
if (show < 0) if (show < 0)
fprintf_filtered (stream, " ... end record"); gdb_printf (stream, " ... end record");
else else
{ {
int flds; int flds;
@ -834,11 +834,11 @@ print_record_type (struct type *type0, struct ui_file *stream, int show,
flags); flags);
if (flds > 0) if (flds > 0)
fprintf_filtered (stream, "\n%*send record", level, ""); gdb_printf (stream, "\n%*send record", level, "");
else if (flds < 0) else if (flds < 0)
fprintf_filtered (stream, _(" <incomplete type> end record")); gdb_printf (stream, _(" <incomplete type> end record"));
else 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) const struct type_print_options *flags)
{ {
if (show < 0) if (show < 0)
fprintf_filtered (stream, "record (?) is ... end record"); gdb_printf (stream, "record (?) is ... end record");
else if (type->num_fields () == 0) else if (type->num_fields () == 0)
fprintf_filtered (stream, "record (?) is null; end record"); gdb_printf (stream, "record (?) is null; end record");
else 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); print_variant_clauses (type, nullptr, type, stream, show, level + 8, flags);
fprintf_filtered (stream, "\n%*send case;\n%*send record", gdb_printf (stream, "\n%*send case;\n%*send record",
level + 4, "", level, ""); 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 if (TYPE_TARGET_TYPE (type) != NULL
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID) && TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)
fprintf_filtered (stream, "procedure"); gdb_printf (stream, "procedure");
else else
fprintf_filtered (stream, "function"); gdb_printf (stream, "function");
if (name != NULL && name[0] != '\0') 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) if (len > 0)
{ {
fprintf_filtered (stream, " ("); gdb_printf (stream, " (");
for (i = 0; i < len; i += 1) for (i = 0; i < len; i += 1)
{ {
if (i > 0) if (i > 0)
@ -899,18 +899,18 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
gdb_puts ("; ", stream); gdb_puts ("; ", stream);
stream->wrap_here (4); 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, ada_print_type (type->field (i).type (), "", stream, -1, 0,
flags); flags);
} }
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
if (TYPE_TARGET_TYPE (type) == NULL) 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) 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); 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 (type == NULL)
{ {
if (is_var_decl) if (is_var_decl)
fprintf_filtered (stream, "%.*s: ", gdb_printf (stream, "%.*s: ",
ada_name_prefix_len (varstring), varstring); ada_name_prefix_len (varstring), varstring);
fprintf_styled (stream, metadata_style.style (), "<null type?>"); fprintf_styled (stream, metadata_style.style (), "<null type?>");
return; return;
} }
if (is_var_decl && type->code () != TYPE_CODE_FUNC) if (is_var_decl && type->code () != TYPE_CODE_FUNC)
fprintf_filtered (stream, "%.*s: ", gdb_printf (stream, "%.*s: ",
ada_name_prefix_len (varstring), varstring); ada_name_prefix_len (varstring), varstring);
if (type_name != NULL && show <= 0 && !ada_is_aligner_type (type)) if (type_name != NULL && show <= 0 && !ada_is_aligner_type (type))
{ {
fprintf_filtered (stream, "%.*s", gdb_printf (stream, "%.*s",
ada_name_prefix_len (type_name), type_name); ada_name_prefix_len (type_name), type_name);
return; return;
} }
@ -980,9 +980,9 @@ ada_print_type (struct type *type0, const char *varstring,
switch (type->code ()) switch (type->code ())
{ {
default: default:
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
c_print_type (type, "", stream, show, level, flags); c_print_type (type, "", stream, show, level, flags);
fprintf_filtered (stream, ">"); gdb_printf (stream, ">");
break; break;
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
@ -990,12 +990,12 @@ ada_print_type (struct type *type0, const char *varstring,
"access" in this case. */ "access" in this case. */
if (type->code () != TYPE_CODE_PTR if (type->code () != TYPE_CODE_PTR
|| strstr (varstring, "___XVL") == nullptr) || strstr (varstring, "___XVL") == nullptr)
fprintf_filtered (stream, "access "); gdb_printf (stream, "access ");
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level,
flags); flags);
break; break;
case TYPE_CODE_REF: case TYPE_CODE_REF:
fprintf_filtered (stream, "<ref> "); gdb_printf (stream, "<ref> ");
ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level,
flags); flags);
break; break;
@ -1003,7 +1003,7 @@ ada_print_type (struct type *type0, const char *varstring,
print_array_type (type, stream, show, level, flags); print_array_type (type, stream, show, level, flags);
break; break;
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
fprintf_filtered (stream, "(false, true)"); gdb_printf (stream, "(false, true)");
break; break;
case TYPE_CODE_INT: case TYPE_CODE_INT:
{ {
@ -1015,7 +1015,7 @@ ada_print_type (struct type *type0, const char *varstring,
pulongest (TYPE_LENGTH (type))); pulongest (TYPE_LENGTH (type)));
else else
{ {
fprintf_filtered (stream, "range "); gdb_printf (stream, "range ");
print_range_type (type, stream, 1 /* bounds_prefered_p */); 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: case TYPE_CODE_RANGE:
if (is_fixed_point_type (type)) if (is_fixed_point_type (type))
{ {
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
print_type_fixed_point (type, stream); print_type_fixed_point (type, stream);
fprintf_filtered (stream, ">"); gdb_printf (stream, ">");
} }
else if (ada_is_modular_type (type)) else if (ada_is_modular_type (type))
fprintf_filtered (stream, "mod %s", gdb_printf (stream, "mod %s",
int_string (ada_modulus (type), 10, 0, 0, 1)); int_string (ada_modulus (type), 10, 0, 0, 1));
else else
{ {
fprintf_filtered (stream, "range "); gdb_printf (stream, "range ");
print_range (type, stream, 1 /* bounds_prefered_p */); print_range (type, stream, 1 /* bounds_prefered_p */);
} }
break; break;
@ -1043,7 +1043,7 @@ ada_print_type (struct type *type0, const char *varstring,
break; break;
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
if (show < 0) if (show < 0)
fprintf_filtered (stream, "(...)"); gdb_printf (stream, "(...)");
else else
print_enum_type (type, stream); print_enum_type (type, stream);
break; break;
@ -1051,8 +1051,8 @@ ada_print_type (struct type *type0, const char *varstring,
if (ada_is_array_descriptor_type (type)) if (ada_is_array_descriptor_type (type))
print_array_type (type, stream, show, level, flags); print_array_type (type, stream, show, level, flags);
else if (ada_is_bogus_array_descriptor (type)) else if (ada_is_bogus_array_descriptor (type))
fprintf_filtered (stream, gdb_printf (stream,
_("array (?) of ? (<mal-formed descriptor>)")); _("array (?) of ? (<mal-formed descriptor>)"));
else else
print_record_type (type, stream, show, level, flags); print_record_type (type, stream, show, level, flags);
break; break;

View file

@ -106,7 +106,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
} }
ada_print_scalar (index_type, low_bound, stream); ada_print_scalar (index_type, low_bound, stream);
fprintf_filtered (stream, " => "); gdb_printf (stream, " => ");
return 1; return 1;
} }
@ -165,17 +165,17 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
{ {
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
fprintf_filtered (stream, ",\n"); gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
{ {
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
} }
} }
else if (options->prettyformat_arrays) else if (options->prettyformat_arrays)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
stream->wrap_here (2 + 2 * recurse); 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; opts.deref_ref = 0;
common_val_print (v0, stream, recurse + 1, &opts, current_language); common_val_print (v0, stream, recurse + 1, &opts, current_language);
annotate_elt_rep (i - i0); annotate_elt_rep (i - i0);
fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"), gdb_printf (stream, _(" %p[<repeats %u times>%p]"),
metadata_style.style ().ptr (), i - i0, nullptr); metadata_style.style ().ptr (), i - i0, nullptr);
annotate_elt_rep_end (); annotate_elt_rep_end ();
} }
@ -228,12 +228,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
{ {
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
fprintf_filtered (stream, ",\n"); gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
{ {
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
} }
stream->wrap_here (2 + 2 * recurse); stream->wrap_here (2 + 2 * recurse);
maybe_print_array_index (index_type, j + low, 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 (); annotate_array_section_end ();
if (i < len) if (i < len)
{ {
fprintf_filtered (stream, "..."); gdb_printf (stream, "...");
} }
value_free_to_mark (mark); 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 <= UCHAR_MAX && isascii (c) && isprint (c))
{ {
if (c == quoter && c == '"') if (c == quoter && c == '"')
fprintf_filtered (stream, "\"\""); gdb_printf (stream, "\"\"");
else else
fprintf_filtered (stream, "%c", c); gdb_printf (stream, "%c", c);
} }
else else
{ {
/* Follow GNAT's lead here and only use 6 digits for /* Follow GNAT's lead here and only use 6 digits for
wide_wide_character. */ 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'); pos = s.find ('e');
if (pos == std::string::npos) if (pos == std::string::npos)
fprintf_filtered (stream, "%s.0", s.c_str ()); gdb_printf (stream, "%s.0", s.c_str ());
else 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 else
fprintf_filtered (stream, "%s", &s[skip_count]); gdb_printf (stream, "%s", &s[skip_count]);
} }
void void
@ -417,7 +417,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
break; break;
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
fprintf_filtered (stream, val ? "true" : "false"); gdb_printf (stream, val ? "true" : "false");
break; break;
case TYPE_CODE_RANGE: 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), ada_emit_char (char_at (string, i, type_len, byte_order),
elttype, stream, '\'', type_len); elttype, stream, '\'', type_len);
gdb_puts ("'", stream); gdb_puts ("'", stream);
fprintf_filtered (stream, _(" %p[<repeats %u times>%p]"), gdb_printf (stream, _(" %p[<repeats %u times>%p]"),
metadata_style.style ().ptr (), reps, nullptr); metadata_style.style ().ptr (), reps, nullptr);
i = rep1 - 1; i = rep1 - 1;
things_printed += options->repeat_count_threshold; things_printed += options->repeat_count_threshold;
need_comma = 1; need_comma = 1;
@ -615,12 +615,12 @@ print_field_values (struct value *value, struct value *outer_value,
} }
if (comma_needed) if (comma_needed)
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
comma_needed = 1; comma_needed = 1;
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
@ -629,9 +629,9 @@ print_field_values (struct value *value, struct value *outer_value,
} }
annotate_field_begin (type->field (i).type ()); annotate_field_begin (type->field (i).type ());
fprintf_filtered (stream, "%.*s", gdb_printf (stream, "%.*s",
ada_name_prefix_len (type->field (i).name ()), ada_name_prefix_len (type->field (i).name ()),
type->field (i).name ()); type->field (i).name ());
annotate_field_name_end (); annotate_field_name_end ();
gdb_puts (" => ", stream); gdb_puts (" => ", stream);
annotate_field_value (); annotate_field_value ();
@ -746,7 +746,7 @@ ada_value_print_ptr (struct value *val,
gdb::unique_xmalloc_ptr<char> name = ada_tag_name (val); gdb::unique_xmalloc_ptr<char> name = ada_tag_name (val);
if (name != NULL) 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; struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
CORE_ADDR addr = extract_typed_address (valaddr, ptr_type); CORE_ADDR addr = extract_typed_address (valaddr, ptr_type);
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
gdb_puts (paddress (gdbarch, addr), stream); gdb_puts (paddress (gdbarch, addr), stream);
} }
else 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 ()); const char *name = ada_enum_name (type->field (i).name ());
if (name[0] == '\'') if (name[0] == '\'')
fprintf_filtered (stream, "%ld %ps", (long) val, gdb_printf (stream, "%ld %ps", (long) val,
styled_string (variable_name_style.style (), styled_string (variable_name_style.style (),
name)); name));
else else
fputs_styled (name, variable_name_style.style (), stream); 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))) if (ada_is_bogus_array_descriptor (value_type (value)))
{ {
fprintf_filtered (stream, "(...?)"); gdb_printf (stream, "(...?)");
return; return;
} }
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
if (print_field_values (value, value, stream, recurse, options, if (print_field_values (value, value, stream, recurse, options,
0, language_def (language_ada)) != 0 0, language_def (language_ada)) != 0
&& options->prettyformat) && options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
/* Implement Ada value_print'ing for the case where TYPE is a /* 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; return;
} }
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
print_optional_low_bound (stream, type, options); print_optional_low_bound (stream, type, options);
if (value_entirely_optimized_out (val)) if (value_entirely_optimized_out (val))
@ -928,7 +928,7 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse,
} }
else else
value_print_array_elements (val, stream, recurse, options, 0); 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 /* 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) if (val == nullptr)
{ {
gdb_assert (type->code () == TYPE_CODE_TYPEDEF); gdb_assert (type->code () == TYPE_CODE_TYPEDEF);
fprintf_filtered (stream, "0x0"); gdb_printf (stream, "0x0");
return; 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)->code () != TYPE_CODE_INT
|| TYPE_TARGET_TYPE (type)->is_unsigned ()) || TYPE_TARGET_TYPE (type)->is_unsigned ())
{ {
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
} }
} }
else if (ada_is_array_descriptor_type (type)) 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). */ a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */
if (type->code () == TYPE_CODE_TYPEDEF) if (type->code () == TYPE_CODE_TYPEDEF)
{ {
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
} }
} }
else if (ada_is_bogus_array_descriptor (type)) else if (ada_is_bogus_array_descriptor (type))
{ {
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") (...?)"); gdb_printf (stream, ") (...?)");
return; return;
} }

View file

@ -612,10 +612,10 @@ addrmap_dump (struct addrmap *map, struct ui_file *outfile, void *payload)
addr_str = "<ends here>"; addr_str = "<ends here>";
if (matches || previous_matched) if (matches || previous_matched)
fprintf_filtered (outfile, " %s%s %s\n", gdb_printf (outfile, " %s%s %s\n",
payload != nullptr ? " " : "", payload != nullptr ? " " : "",
core_addr_to_string (start_addr), core_addr_to_string (start_addr),
addr_str); addr_str);
previous_matched = matches; previous_matched = matches;

View file

@ -40,9 +40,9 @@ static void
show_can_use_agent (struct ui_file *file, int from_tty, show_can_use_agent (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Debugger's willingness to use agent in inferior " _("Debugger's willingness to use agent in inferior "
"as a helper is %s.\n"), value); "as a helper is %s.\n"), value);
} }
static void static void

View file

@ -266,9 +266,9 @@ ptrace_check (int req, int id, int ret)
if (ret == -1 && errno == EPERM) if (ret == -1 && errno == EPERM)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"ptrace (%d, %d) = %d (errno = %d)\n", "ptrace (%d, %d) = %d (errno = %d)\n",
req, id, ret, errno); req, id, ret, errno);
return ret == -1 ? 0 : 1; return ret == -1 ? 0 : 1;
} }
break; break;
@ -338,16 +338,16 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
char *name; char *name;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_symbol_addrs (user = %ld, symbols = 0x%lx, count = %d)\n", "pdc_symbol_addrs (user = %ld, symbols = 0x%lx, count = %d)\n",
user, (long) symbols, count); user, (long) symbols, count);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
name = symbols[i].name; name = symbols[i].name;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
" symbols[%d].name = \"%s\"\n", i, name); " symbols[%d].name = \"%s\"\n", i, name);
if (!*name) if (!*name)
symbols[i].addr = 0; 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 (ms.minsym == NULL)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n"); gdb_printf (gdb_stdlog, " returning PDC_FAILURE\n");
return PDC_FAILURE; return PDC_FAILURE;
} }
symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms); symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
} }
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n", gdb_printf (gdb_stdlog, " symbols[%d].addr = %s\n",
i, hex_string (symbols[i].addr)); i, hex_string (symbols[i].addr));
} }
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " returning PDC_SUCCESS\n"); gdb_printf (gdb_stdlog, " returning PDC_SUCCESS\n");
return PDC_SUCCESS; return PDC_SUCCESS;
} }
@ -396,8 +396,8 @@ pdc_read_regs (pthdb_user_t user,
struct ptsprs sprs32; struct ptsprs sprs32;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n", gdb_printf (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
(int) tid, hex_string (flags)); (int) tid, hex_string (flags));
/* General-purpose registers. */ /* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS) if (flags & PTHDB_FLAG_GPRS)
@ -462,8 +462,8 @@ pdc_write_regs (pthdb_user_t user,
however this code is untested. */ however this code is untested. */
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n", gdb_printf (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
(int) tid, hex_string (flags)); (int) tid, hex_string (flags));
/* General-purpose registers. */ /* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS) if (flags & PTHDB_FLAG_GPRS)
@ -506,16 +506,16 @@ pdc_read_data (pthdb_user_t user, void *buf,
int status, ret; int status, ret;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", "pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
user, (long) buf, hex_string (addr), len); user, (long) buf, hex_string (addr), len);
status = target_read_memory (addr, (gdb_byte *) buf, len); status = target_read_memory (addr, (gdb_byte *) buf, len);
ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE; ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n", gdb_printf (gdb_stdlog, " status=%d, returning %s\n",
status, pd_status2str (ret)); status, pd_status2str (ret));
return ret; return ret;
} }
@ -528,16 +528,16 @@ pdc_write_data (pthdb_user_t user, void *buf,
int status, ret; int status, ret;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", "pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
user, (long) buf, hex_string (addr), len); user, (long) buf, hex_string (addr), len);
status = target_write_memory (addr, (gdb_byte *) buf, len); status = target_write_memory (addr, (gdb_byte *) buf, len);
ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE; ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n", status, gdb_printf (gdb_stdlog, " status=%d, returning %s\n", status,
pd_status2str (ret)); pd_status2str (ret));
return ret; return ret;
} }
@ -548,13 +548,13 @@ static int
pdc_alloc (pthdb_user_t user, size_t len, void **bufp) pdc_alloc (pthdb_user_t user, size_t len, void **bufp)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n", "pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
user, len, (long) bufp); user, len, (long) bufp);
*bufp = xmalloc (len); *bufp = xmalloc (len);
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
" malloc returned 0x%lx\n", (long) *bufp); " malloc returned 0x%lx\n", (long) *bufp);
/* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never /* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never
be returned. */ be returned. */
@ -570,13 +570,13 @@ static int
pdc_realloc (pthdb_user_t user, void *buf, size_t len, void **bufp) pdc_realloc (pthdb_user_t user, void *buf, size_t len, void **bufp)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_realloc (user = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n", "pdc_realloc (user = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n",
user, (long) buf, len, (long) bufp); user, (long) buf, len, (long) bufp);
*bufp = xrealloc (buf, len); *bufp = xrealloc (buf, len);
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
" realloc returned 0x%lx\n", (long) *bufp); " realloc returned 0x%lx\n", (long) *bufp);
return *bufp ? PDC_SUCCESS : PDC_FAILURE; return *bufp ? PDC_SUCCESS : PDC_FAILURE;
} }
@ -587,9 +587,9 @@ static int
pdc_dealloc (pthdb_user_t user, void *buf) pdc_dealloc (pthdb_user_t user, void *buf)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"pdc_free (user = %ld, buf = 0x%lx)\n", user, "pdc_free (user = %ld, buf = 0x%lx)\n", user,
(long) buf); (long) buf);
xfree (buf); xfree (buf);
return PDC_SUCCESS; return PDC_SUCCESS;
} }
@ -1227,8 +1227,8 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
pthdb_context_t ctx; pthdb_context_t ctx;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"fetch_regs_user_thread %lx\n", (long) pdtid); "fetch_regs_user_thread %lx\n", (long) pdtid);
status = pthdb_pthread_context (pd_session, pdtid, &ctx); status = pthdb_pthread_context (pd_session, pdtid, &ctx);
if (status != PTHDB_SUCCESS) if (status != PTHDB_SUCCESS)
error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"), 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; int i;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"fetch_regs_kernel_thread tid=%lx regno=%d arch64=%d\n", "fetch_regs_kernel_thread tid=%lx regno=%d arch64=%d\n",
(long) tid, regno, arch64); (long) tid, regno, arch64);
/* General-purpose registers. */ /* General-purpose registers. */
if (regno == -1 if (regno == -1
@ -1509,8 +1509,8 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
uint64_t int64; uint64_t int64;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"store_regs_user_thread %lx\n", (long) pdtid); "store_regs_user_thread %lx\n", (long) pdtid);
/* Retrieve the thread's current context for its non-register /* Retrieve the thread's current context for its non-register
values. */ values. */
@ -1600,9 +1600,9 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
struct ptsprs sprs32; struct ptsprs sprs32;
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"store_regs_kernel_thread tid=%lx regno=%d\n", "store_regs_kernel_thread tid=%lx regno=%d\n",
(long) tid, regno); (long) tid, regno);
/* General-purpose registers. */ /* General-purpose registers. */
if (regno == -1 if (regno == -1

View file

@ -1102,7 +1102,7 @@ enclosing function for address %s"), paddress (gdbarch, orig_pc));
if (!blurb_printed) if (!blurb_printed)
{ {
printf_filtered (_("\ gdb_printf (_("\
This warning occurs if you are debugging a function without any symbols\n\ 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\ (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\ increase the size of the search with the `set heuristic-fence-post' command.\n\

View file

@ -1496,10 +1496,10 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
if (syscall_gdb == gdb_sys_no_syscall) if (syscall_gdb == gdb_sys_no_syscall)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record and replay target doesn't " _("Process record and replay target doesn't "
"support syscall number %s\n"), "support syscall number %s\n"),
pulongest (syscall_native)); pulongest (syscall_native));
return -1; return -1;
} }
else else

View file

@ -293,7 +293,7 @@ void
annotate_error_begin (void) annotate_error_begin (void)
{ {
if (annotation_level > 1) if (annotation_level > 1)
fprintf_unfiltered (gdb_stderr, "\n\032\032error-begin\n"); gdb_printf (gdb_stderr, "\n\032\032error-begin\n");
} }
void void

View file

@ -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. */ /* JLI and EI depend on optional AUX registers. Not supported right now. */
else if (insn.insn_class == JLI) else if (insn.insn_class == JLI)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
"JLI_S instruction is not supported by the GDB."); "JLI_S instruction is not supported by the GDB.");
return 0; return 0;
} }
else if (insn.insn_class == EI) else if (insn.insn_class == EI)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
"EI_S instruction is not supported by the GDB."); "EI_S instruction is not supported by the GDB.");
return 0; return 0;
} }
/* LEAVE_S: PC = BLINK. */ /* 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); 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", gdb_printf (file, "arc_dump_tdep: is_sigtramp = <%s>\n",
host_address_to_string (tdep->is_sigtramp)); host_address_to_string (tdep->is_sigtramp));
fprintf_filtered (file, "arc_dump_tdep: sigcontext_addr = <%s>\n", gdb_printf (file, "arc_dump_tdep: sigcontext_addr = <%s>\n",
host_address_to_string (tdep->sigcontext_addr)); host_address_to_string (tdep->sigcontext_addr));
fprintf_filtered (file, "arc_dump_tdep: sc_reg_offset = <%s>\n", gdb_printf (file, "arc_dump_tdep: sc_reg_offset = <%s>\n",
host_address_to_string (tdep->sc_reg_offset)); host_address_to_string (tdep->sc_reg_offset));
fprintf_filtered (file, "arc_dump_tdep: sc_num_regs = %d\n", gdb_printf (file, "arc_dump_tdep: sc_num_regs = %d\n",
tdep->sc_num_regs); tdep->sc_num_regs);
} }
/* This command accepts single argument - address of instruction to /* This command accepts single argument - address of instruction to

View file

@ -110,7 +110,7 @@ enum arc_regnum
/* Special value for register offset arrays. */ /* Special value for register offset arrays. */
#define ARC_OFFSET_NO_REGISTER (-1) #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; extern bool arc_debug;

View file

@ -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 (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG) if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG)
fprintf_filtered (file, _("The target endianness is set automatically " gdb_printf (file, _("The target endianness is set automatically "
"(currently big endian).\n")); "(currently big endian).\n"));
else else
fprintf_filtered (file, _("The target endianness is set automatically " gdb_printf (file, _("The target endianness is set automatically "
"(currently little endian).\n")); "(currently little endian).\n"));
else else
if (target_byte_order_user == BFD_ENDIAN_BIG) if (target_byte_order_user == BFD_ENDIAN_BIG)
fprintf_filtered (file, gdb_printf (file,
_("The target is set to big endian.\n")); _("The target is set to big endian.\n"));
else else
fprintf_filtered (file, gdb_printf (file,
_("The target is set to little endian.\n")); _("The target is set to little endian.\n"));
} }
static void 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; info.byte_order = BFD_ENDIAN_LITTLE;
if (! gdbarch_update_p (info)) if (! gdbarch_update_p (info))
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Little endian target not supported by GDB\n")); _("Little endian target not supported by GDB\n"));
else else
target_byte_order_user = BFD_ENDIAN_LITTLE; 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; info.byte_order = BFD_ENDIAN_BIG;
if (! gdbarch_update_p (info)) if (! gdbarch_update_p (info))
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Big endian target not supported by GDB\n")); _("Big endian target not supported by GDB\n"));
else else
target_byte_order_user = BFD_ENDIAN_BIG; 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) struct cmd_list_element *c, const char *value)
{ {
if (target_architecture_user == NULL) if (target_architecture_user == NULL)
fprintf_filtered (file, _("The target architecture is set to " gdb_printf (file, _("The target architecture is set to "
"\"auto\" (currently \"%s\").\n"), "\"auto\" (currently \"%s\").\n"),
gdbarch_bfd_arch_info (get_current_arch ())->printable_name); gdbarch_bfd_arch_info (get_current_arch ())->printable_name);
else else
fprintf_filtered (file, _("The target architecture is set to \"%s\".\n"), gdb_printf (file, _("The target architecture is set to \"%s\".\n"),
set_architecture_string); set_architecture_string);
} }
@ -569,9 +569,9 @@ set_architecture (const char *ignore_args,
if (gdbarch_update_p (info)) if (gdbarch_update_p (info))
target_architecture_user = info.bfd_arch_info; target_architecture_user = info.bfd_arch_info;
else else
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Architecture `%s' not recognized.\n"), _("Architecture `%s' not recognized.\n"),
set_architecture_string); set_architecture_string);
} }
show_architecture (gdb_stdout, from_tty, NULL, NULL); show_architecture (gdb_stdout, from_tty, NULL, NULL);
} }
@ -599,8 +599,8 @@ gdbarch_update_p (struct gdbarch_info info)
if (new_gdbarch == NULL) if (new_gdbarch == NULL)
{ {
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: " gdb_printf (gdb_stdlog, "gdbarch_update_p: "
"Architecture not found\n"); "Architecture not found\n");
return 0; return 0;
} }
@ -609,19 +609,19 @@ gdbarch_update_p (struct gdbarch_info info)
if (new_gdbarch == target_gdbarch ()) if (new_gdbarch == target_gdbarch ())
{ {
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: " gdb_printf (gdb_stdlog, "gdbarch_update_p: "
"Architecture %s (%s) unchanged\n", "Architecture %s (%s) unchanged\n",
host_address_to_string (new_gdbarch), host_address_to_string (new_gdbarch),
gdbarch_bfd_arch_info (new_gdbarch)->printable_name); gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
return 1; return 1;
} }
/* It's a new architecture, swap it in. */ /* It's a new architecture, swap it in. */
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: " gdb_printf (gdb_stdlog, "gdbarch_update_p: "
"New architecture %s (%s) selected\n", "New architecture %s (%s) selected\n",
host_address_to_string (new_gdbarch), host_address_to_string (new_gdbarch),
gdbarch_bfd_arch_info (new_gdbarch)->printable_name); gdbarch_bfd_arch_info (new_gdbarch)->printable_name);
set_target_gdbarch (new_gdbarch); set_target_gdbarch (new_gdbarch);
return 1; return 1;
@ -1106,7 +1106,7 @@ static void
show_gdbarch_debug (struct ui_file *file, int from_tty, show_gdbarch_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) 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 * static const char *
@ -1202,7 +1202,7 @@ struct gdbarch_tdep *
gdbarch_tdep (struct gdbarch *gdbarch) gdbarch_tdep (struct gdbarch *gdbarch)
{ {
if (gdbarch_debug >= 2) if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); gdb_printf (gdb_stdlog, "gdbarch_tdep called\n");
return gdbarch->tdep; return gdbarch->tdep;
} }
@ -1385,9 +1385,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
} }
/* log it */ /* log it */
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n", gdb_printf (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
bfd_arch_info->printable_name, bfd_arch_info->printable_name,
host_address_to_string (init)); host_address_to_string (init));
/* Append it */ /* Append it */
(*curr) = XNEW (struct gdbarch_registration); (*curr) = XNEW (struct gdbarch_registration);
(*curr)->bfd_architecture = bfd_architecture; (*curr)->bfd_architecture = bfd_architecture;
@ -1446,23 +1446,23 @@ gdbarch_find_by_info (struct gdbarch_info info)
if (gdbarch_debug) if (gdbarch_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gdbarch_find_by_info: info.bfd_arch_info %s\n", "gdbarch_find_by_info: info.bfd_arch_info %s\n",
(info.bfd_arch_info != NULL (info.bfd_arch_info != NULL
? info.bfd_arch_info->printable_name ? info.bfd_arch_info->printable_name
: "(null)")); : "(null)"));
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gdbarch_find_by_info: info.byte_order %d (%s)\n", "gdbarch_find_by_info: info.byte_order %d (%s)\n",
info.byte_order, info.byte_order,
(info.byte_order == BFD_ENDIAN_BIG ? "big" (info.byte_order == BFD_ENDIAN_BIG ? "big"
: info.byte_order == BFD_ENDIAN_LITTLE ? "little" : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
: "default")); : "default"));
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gdbarch_find_by_info: info.osabi %d (%s)\n", "gdbarch_find_by_info: info.osabi %d (%s)\n",
info.osabi, gdbarch_osabi_name (info.osabi)); info.osabi, gdbarch_osabi_name (info.osabi));
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gdbarch_find_by_info: info.abfd %s\n", "gdbarch_find_by_info: info.abfd %s\n",
host_address_to_string (info.abfd)); host_address_to_string (info.abfd));
} }
/* Find the tdep code that knows about this architecture. */ /* 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 (rego == NULL)
{ {
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
"No matching architecture\n"); "No matching architecture\n");
return 0; return 0;
} }
@ -1487,8 +1487,8 @@ gdbarch_find_by_info (struct gdbarch_info info)
if (new_gdbarch == NULL) if (new_gdbarch == NULL)
{ {
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
"Target rejected architecture\n"); "Target rejected architecture\n");
return NULL; return NULL;
} }
@ -1500,10 +1500,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
struct gdbarch_list **list; struct gdbarch_list **list;
struct gdbarch_list *self; struct gdbarch_list *self;
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
"Previous architecture %s (%s) selected\n", "Previous architecture %s (%s) selected\n",
host_address_to_string (new_gdbarch), host_address_to_string (new_gdbarch),
new_gdbarch->bfd_arch_info->printable_name); new_gdbarch->bfd_arch_info->printable_name);
/* Find the existing arch in the list. */ /* Find the existing arch in the list. */
for (list = &rego->arches; for (list = &rego->arches;
(*list) != NULL && (*list)->gdbarch != new_gdbarch; (*list) != NULL && (*list)->gdbarch != new_gdbarch;
@ -1522,10 +1522,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
/* It's a new architecture. */ /* It's a new architecture. */
if (gdbarch_debug) if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: " gdb_printf (gdb_stdlog, "gdbarch_find_by_info: "
"New architecture %s (%s) selected\n", "New architecture %s (%s) selected\n",
host_address_to_string (new_gdbarch), host_address_to_string (new_gdbarch),
new_gdbarch->bfd_arch_info->printable_name); new_gdbarch->bfd_arch_info->printable_name);
/* Insert the new architecture into the front of the architecture /* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */ list (keep the list sorted Most Recently Used). */

View file

@ -1650,10 +1650,10 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
if (syscall_gdb == gdb_sys_no_syscall) if (syscall_gdb == gdb_sys_no_syscall)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record and replay target doesn't " _("Process record and replay target doesn't "
"support syscall number %s\n"), "support syscall number %s\n"),
plongest (svc_number)); plongest (svc_number));
return -1; return -1;
} }

View file

@ -4038,9 +4038,9 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
type = (status >> 24) & 127; type = (status >> 24) & 127;
if (status & (1 << 31)) if (status & (1 << 31))
fprintf_filtered (file, _("Hardware FPU type %d\n"), type); gdb_printf (file, _("Hardware FPU type %d\n"), type);
else else
fprintf_filtered (file, _("Software FPU type %d\n"), type); gdb_printf (file, _("Software FPU type %d\n"), type);
/* i18n: [floating point unit] mask */ /* i18n: [floating point unit] mask */
gdb_puts (_("mask: "), file); gdb_puts (_("mask: "), file);
print_fpu_flags (file, status >> 16); 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 if (arm_fp_model == ARM_FLOAT_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm) && 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"), The current ARM floating point model is \"auto\" (currently \"%s\").\n"),
fp_model_strings[tdep->fp_model]); fp_model_strings[tdep->fp_model]);
else else
fprintf_filtered (file, _("\ gdb_printf (file, _("\
The current ARM floating point model is \"%s\".\n"), The current ARM floating point model is \"%s\".\n"),
fp_model_strings[arm_fp_model]); fp_model_strings[arm_fp_model]);
} }
static void static void
@ -8589,32 +8589,32 @@ arm_show_abi (struct ui_file *file, int from_tty,
if (arm_abi_global == ARM_ABI_AUTO if (arm_abi_global == ARM_ABI_AUTO
&& gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_arm) && 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"), The current ARM ABI is \"auto\" (currently \"%s\").\n"),
arm_abi_strings[tdep->arm_abi]); arm_abi_strings[tdep->arm_abi]);
else else
fprintf_filtered (file, _("The current ARM ABI is \"%s\".\n"), gdb_printf (file, _("The current ARM ABI is \"%s\".\n"),
arm_abi_string); arm_abi_string);
} }
static void static void
arm_show_fallback_mode (struct ui_file *file, int from_tty, arm_show_fallback_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("The current execution mode assumed " _("The current execution mode assumed "
"(when symbols are unavailable) is \"%s\".\n"), "(when symbols are unavailable) is \"%s\".\n"),
arm_fallback_mode_string); arm_fallback_mode_string);
} }
static void static void
arm_show_force_mode (struct ui_file *file, int from_tty, arm_show_force_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("The current execution mode assumed " _("The current execution mode assumed "
"(even when symbols are available) is \"%s\".\n"), "(even when symbols are available) is \"%s\".\n"),
arm_force_mode_string); arm_force_mode_string);
} }
/* If the user changes the register disassembly style used for info /* 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, ","); 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);
} }
/* Return the ARM register name corresponding to register I. */ /* 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) if (tdep == NULL)
return; return;
fprintf_filtered (file, _("arm_dump_tdep: fp_model = %i\n"), gdb_printf (file, _("arm_dump_tdep: fp_model = %i\n"),
(int) tdep->fp_model); (int) tdep->fp_model);
fprintf_filtered (file, _("arm_dump_tdep: have_fpa_registers = %i\n"), gdb_printf (file, _("arm_dump_tdep: have_fpa_registers = %i\n"),
(int) tdep->have_fpa_registers); (int) tdep->have_fpa_registers);
fprintf_filtered (file, _("arm_dump_tdep: have_wmmx_registers = %i\n"), gdb_printf (file, _("arm_dump_tdep: have_wmmx_registers = %i\n"),
(int) tdep->have_wmmx_registers); (int) tdep->have_wmmx_registers);
fprintf_filtered (file, _("arm_dump_tdep: vfp_register_count = %i\n"), gdb_printf (file, _("arm_dump_tdep: vfp_register_count = %i\n"),
(int) tdep->vfp_register_count); (int) tdep->vfp_register_count);
fprintf_filtered (file, _("arm_dump_tdep: have_s_pseudos = %s\n"), gdb_printf (file, _("arm_dump_tdep: have_s_pseudos = %s\n"),
tdep->have_s_pseudos? "true" : "false"); tdep->have_s_pseudos? "true" : "false");
fprintf_filtered (file, _("arm_dump_tdep: s_pseudo_base = %i\n"), gdb_printf (file, _("arm_dump_tdep: s_pseudo_base = %i\n"),
(int) tdep->s_pseudo_base); (int) tdep->s_pseudo_base);
fprintf_filtered (file, _("arm_dump_tdep: s_pseudo_count = %i\n"), gdb_printf (file, _("arm_dump_tdep: s_pseudo_count = %i\n"),
(int) tdep->s_pseudo_count); (int) tdep->s_pseudo_count);
fprintf_filtered (file, _("arm_dump_tdep: have_q_pseudos = %s\n"), gdb_printf (file, _("arm_dump_tdep: have_q_pseudos = %s\n"),
tdep->have_q_pseudos? "true" : "false"); tdep->have_q_pseudos? "true" : "false");
fprintf_filtered (file, _("arm_dump_tdep: q_pseudo_base = %i\n"), gdb_printf (file, _("arm_dump_tdep: q_pseudo_base = %i\n"),
(int) tdep->q_pseudo_base); (int) tdep->q_pseudo_base);
fprintf_filtered (file, _("arm_dump_tdep: q_pseudo_count = %i\n"), gdb_printf (file, _("arm_dump_tdep: q_pseudo_count = %i\n"),
(int) tdep->q_pseudo_count); (int) tdep->q_pseudo_count);
fprintf_filtered (file, _("arm_dump_tdep: have_neon = %i\n"), gdb_printf (file, _("arm_dump_tdep: have_neon = %i\n"),
(int) tdep->have_neon); (int) tdep->have_neon);
fprintf_filtered (file, _("arm_dump_tdep: have_mve = %s\n"), gdb_printf (file, _("arm_dump_tdep: have_mve = %s\n"),
tdep->have_mve? "yes" : "no"); tdep->have_mve? "yes" : "no");
fprintf_filtered (file, _("arm_dump_tdep: mve_vpr_regnum = %i\n"), gdb_printf (file, _("arm_dump_tdep: mve_vpr_regnum = %i\n"),
tdep->mve_vpr_regnum); tdep->mve_vpr_regnum);
fprintf_filtered (file, _("arm_dump_tdep: mve_pseudo_base = %i\n"), gdb_printf (file, _("arm_dump_tdep: mve_pseudo_base = %i\n"),
tdep->mve_pseudo_base); tdep->mve_pseudo_base);
fprintf_filtered (file, _("arm_dump_tdep: mve_pseudo_count = %i\n"), gdb_printf (file, _("arm_dump_tdep: mve_pseudo_count = %i\n"),
tdep->mve_pseudo_count); tdep->mve_pseudo_count);
fprintf_filtered (file, _("arm_dump_tdep: Lowest pc = 0x%lx\n"), gdb_printf (file, _("arm_dump_tdep: Lowest pc = 0x%lx\n"),
(unsigned long) tdep->lowest_pc); (unsigned long) tdep->lowest_pc);
} }
#if GDB_SELF_TEST #if GDB_SELF_TEST
@ -11359,10 +11359,10 @@ arm_record_b_bl (insn_decode_record *arm_insn_r)
static int static int
arm_record_unsupported_insn (insn_decode_record *arm_insn_r) arm_record_unsupported_insn (insn_decode_record *arm_insn_r)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record does not support instruction " _("Process record does not support instruction "
"0x%0x at address %s.\n"),arm_insn_r->arm_insn, "0x%0x at address %s.\n"),arm_insn_r->arm_insn,
paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr)); paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr));
return -1; return -1;
} }
@ -11948,7 +11948,7 @@ arm_record_coproc_data_proc (insn_decode_record *arm_insn_r)
} }
else else
{ {
fprintf_unfiltered (gdb_stderr, _("no syscall record support\n")); gdb_printf (gdb_stderr, _("no syscall record support\n"));
return -1; return -1;
} }
} }
@ -12380,12 +12380,12 @@ thumb_record_misc (insn_decode_record *thumb_insn_r)
record_buf[1] = ARM_LR_REGNUM; record_buf[1] = ARM_LR_REGNUM;
thumb_insn_r->reg_rec_count = 2; thumb_insn_r->reg_rec_count = 2;
/* We need to save SPSR value, which is not yet done. */ /* We need to save SPSR value, which is not yet done. */
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Process record does not support instruction " _("Process record does not support instruction "
"0x%0x at address %s.\n"), "0x%0x at address %s.\n"),
thumb_insn_r->arm_insn, thumb_insn_r->arm_insn,
paddress (thumb_insn_r->gdbarch, paddress (thumb_insn_r->gdbarch,
thumb_insn_r->this_addr)); thumb_insn_r->this_addr));
return -1; return -1;
case 0xf: case 0xf:
@ -12473,7 +12473,7 @@ thumb_record_ldm_stm_swi (insn_decode_record *thumb_insn_r)
} }
else else
{ {
fprintf_unfiltered (gdb_stderr, _("no syscall record support\n")); gdb_printf (gdb_stderr, _("no syscall record support\n"));
return -1; return -1;
} }
} }
@ -13384,11 +13384,11 @@ decode_insn (abstract_memory_reader &reader, insn_decode_record *arm_record,
{ {
if (record_debug) if (record_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_("Process record: error reading memory at " _("Process record: error reading memory at "
"addr %s len = %d.\n"), "addr %s len = %d.\n"),
paddress (arm_record->gdbarch, paddress (arm_record->gdbarch,
arm_record->this_addr), insn_size); arm_record->this_addr), insn_size);
} }
return -1; return -1;
} }
@ -13643,9 +13643,9 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
if (record_debug > 1) if (record_debug > 1)
{ {
fprintf_unfiltered (gdb_stdlog, "Process record: arm_process_record " gdb_printf (gdb_stdlog, "Process record: arm_process_record "
"addr = %s\n", "addr = %s\n",
paddress (gdbarch, arm_record.this_addr)); paddress (gdbarch, arm_record.this_addr));
} }
instruction_reader reader; instruction_reader reader;
@ -13653,11 +13653,11 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
{ {
if (record_debug) if (record_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_("Process record: error reading memory at " _("Process record: error reading memory at "
"addr %s len = %d.\n"), "addr %s len = %d.\n"),
paddress (arm_record.gdbarch, paddress (arm_record.gdbarch,
arm_record.this_addr), 2); arm_record.this_addr), 2);
} }
return -1; return -1;
} }

View file

@ -74,9 +74,9 @@ static void
show_debug_auto_load (struct ui_file *file, int from_tty, show_debug_auto_load (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging output for files " gdb_printf (file, _("Debugging output for files "
"of 'set auto-load ...' is %s.\n"), "of 'set auto-load ...' is %s.\n"),
value); value);
} }
/* User-settable option to enable/disable auto-loading of GDB_AUTO_FILE_NAME /* 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, show_auto_load_gdb_scripts (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Auto-loading of canned sequences of commands " gdb_printf (file, _("Auto-loading of canned sequences of commands "
"scripts is %s.\n"), "scripts is %s.\n"),
value); value);
} }
/* See auto-load.h. */ /* See auto-load.h. */
@ -132,9 +132,9 @@ static void
show_auto_load_local_gdbinit (struct ui_file *file, int from_tty, show_auto_load_local_gdbinit (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Auto-loading of .gdbinit script from current " gdb_printf (file, _("Auto-loading of .gdbinit script from current "
"directory is %s.\n"), "directory is %s.\n"),
value); value);
} }
/* Directory list from which to load auto-loaded scripts. It is not checked /* 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, show_auto_load_dir (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("List of directories from which to load " gdb_printf (file, _("List of directories from which to load "
"auto-loaded scripts is %s.\n"), "auto-loaded scripts is %s.\n"),
value); value);
} }
/* Directory list safe to hold auto-loaded files. It is not checked for /* 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)); for (cs = value; *cs && (*cs == DIRNAME_SEPARATOR || IS_DIR_SEPARATOR (*cs));
cs++); cs++);
if (*cs == 0) if (*cs == 0)
fprintf_filtered (file, _("Auto-load files are safe to load from any " gdb_printf (file, _("Auto-load files are safe to load from any "
"directory.\n")); "directory.\n"));
else else
fprintf_filtered (file, _("List of directories from which it is safe to " gdb_printf (file, _("List of directories from which it is safe to "
"auto-load files is %s.\n"), "auto-load files is %s.\n"),
value); value);
} }
/* "add-auto-load-safe-path" command for the auto_load_safe_path configuration /* "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\ To enable execution of this file add\n\
\tadd-auto-load-safe-path %s\n\ \tadd-auto-load-safe-path %s\n\
line to your configuration file \"%ps\".\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) info_auto_load_local_gdbinit (const char *args, int from_tty)
{ {
if (auto_load_local_gdbinit_pathname == NULL) 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) else if (auto_load_local_gdbinit_loaded)
printf_filtered (_("Local .gdbinit file \"%ps\" has been loaded.\n"), gdb_printf (_("Local .gdbinit file \"%ps\" has been loaded.\n"),
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
auto_load_local_gdbinit_pathname)); auto_load_local_gdbinit_pathname));
else else
printf_filtered (_("Local .gdbinit file \"%ps\" has not been loaded.\n"), gdb_printf (_("Local .gdbinit file \"%ps\" has not been loaded.\n"),
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
auto_load_local_gdbinit_pathname)); auto_load_local_gdbinit_pathname));
} }
/* Print an "unsupported script" warning if it has not already been printed. /* Print an "unsupported script" warning if it has not already been printed.

View file

@ -414,15 +414,15 @@ fprint_auxv_entry (struct ui_file *file, const char *name,
const char *description, enum auxv_format format, const char *description, enum auxv_format format,
CORE_ADDR type, CORE_ADDR val) CORE_ADDR type, CORE_ADDR val)
{ {
fprintf_filtered (file, ("%-4s %-20s %-30s "), gdb_printf (file, ("%-4s %-20s %-30s "),
plongest (type), name, description); plongest (type), name, description);
switch (format) switch (format)
{ {
case AUXV_FORMAT_DEC: case AUXV_FORMAT_DEC:
fprintf_filtered (file, ("%s\n"), plongest (val)); gdb_printf (file, ("%s\n"), plongest (val));
break; break;
case AUXV_FORMAT_HEX: case AUXV_FORMAT_HEX:
fprintf_filtered (file, ("%s\n"), paddress (target_gdbarch (), val)); gdb_printf (file, ("%s\n"), paddress (target_gdbarch (), val));
break; break;
case AUXV_FORMAT_STR: case AUXV_FORMAT_STR:
{ {
@ -430,10 +430,10 @@ fprint_auxv_entry (struct ui_file *file, const char *name,
get_user_print_options (&opts); get_user_print_options (&opts);
if (opts.addressprint) 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, val_print_string (builtin_type (target_gdbarch ())->builtin_char,
NULL, val, -1, file, &opts); NULL, val, -1, file, &opts);
fprintf_filtered (file, ("\n")); gdb_printf (file, ("\n"));
} }
break; break;
} }

View file

@ -668,8 +668,8 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
if (num_pushes > AVR_MAX_PUSHES) if (num_pushes > AVR_MAX_PUSHES)
{ {
fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"), gdb_printf (gdb_stderr, _("Num pushes too large: %d\n"),
num_pushes); num_pushes);
num_pushes = 0; num_pushes = 0;
} }
@ -1574,9 +1574,9 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (!buf) if (!buf)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("ERR: info io_registers NOT supported " _("ERR: info io_registers NOT supported "
"by current target\n")); "by current target\n"));
return; return;
} }
@ -1584,12 +1584,12 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (sscanf (bufstr, "%x", &nreg) != 1) if (sscanf (bufstr, "%x", &nreg) != 1)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Error fetching number of io registers\n")); _("Error fetching number of io registers\n"));
return; 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 */ /* only fetch up to 8 registers at a time to keep the buffer small */
int step = 8; int step = 8;
@ -1607,9 +1607,9 @@ avr_io_reg_read_command (const char *args, int from_tty)
if (!buf) if (!buf)
{ {
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("ERR: error reading avr.io_reg:%x,%x\n"), _("ERR: error reading avr.io_reg:%x,%x\n"),
i, j); i, j);
return; return;
} }
@ -1618,7 +1618,7 @@ avr_io_reg_read_command (const char *args, int from_tty)
{ {
if (sscanf (p, "%[^,],%x;", query, &val) == 2) 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')) while ((*p != ';') && (*p != '\0'))
p++; p++;
p++; /* skip over ';' */ p++; /* skip over ';' */

View file

@ -365,11 +365,11 @@ ax_print (struct ui_file *f, struct agent_expr *x)
{ {
int i; int i;
fprintf_filtered (f, _("Scope: %s\n"), paddress (x->gdbarch, x->scope)); gdb_printf (f, _("Scope: %s\n"), paddress (x->gdbarch, x->scope));
fprintf_filtered (f, _("Reg mask:")); gdb_printf (f, _("Reg mask:"));
for (i = 0; i < x->reg_mask_len; ++i) for (i = 0; i < x->reg_mask_len; ++i)
fprintf_filtered (f, _(" %02x"), x->reg_mask[i]); gdb_printf (f, _(" %02x"), x->reg_mask[i]);
fprintf_filtered (f, _("\n")); gdb_printf (f, _("\n"));
/* Check the size of the name array against the number of entries in /* Check the size of the name array against the number of entries in
the enum, to catch additions that people didn't sync. */ 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])) if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
|| !aop_map[op].name) || !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++; i++;
continue; continue;
} }
if (i + 1 + aop_map[op].op_size > x->len) if (i + 1 + aop_map[op].op_size > x->len)
{ {
fprintf_filtered (f, _("%3d <incomplete opcode %s>\n"), gdb_printf (f, _("%3d <incomplete opcode %s>\n"),
i, aop_map[op].name); i, aop_map[op].name);
break; 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) if (aop_map[op].op_size > 0)
{ {
gdb_puts (" ", f); gdb_puts (" ", f);
@ -412,11 +412,11 @@ ax_print (struct ui_file *f, struct agent_expr *x)
nargs = x->buf[i++]; nargs = x->buf[i++];
slen = x->buf[i++]; slen = x->buf[i++];
slen = slen * 256 + x->buf[i++]; slen = slen * 256 + x->buf[i++];
fprintf_filtered (f, _(" \"%s\", %d args"), gdb_printf (f, _(" \"%s\", %d args"),
&(x->buf[i]), nargs); &(x->buf[i]), nargs);
i += slen - 1; i += slen - 1;
} }
fprintf_filtered (f, "\n"); gdb_printf (f, "\n");
i += 1 + aop_map[op].op_size; i += 1 + aop_map[op].op_size;
} }
} }

View file

@ -245,15 +245,15 @@ print_percentage (int portion, int total)
{ {
if (total == 0) if (total == 0)
/* i18n: Like "Percentage of duplicates, by count: (not applicable)". */ /* i18n: Like "Percentage of duplicates, by count: (not applicable)". */
printf_filtered (_("(not applicable)\n")); gdb_printf (_("(not applicable)\n"));
else 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 /* Print statistics on BCACHE's memory usage and efficacity at
eliminating duplication. NAME should describe the kind of data 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. */ its ilk. */
void void
bcache::print_statistics (const char *type) bcache::print_statistics (const char *type)
@ -325,59 +325,59 @@ bcache::print_statistics (const char *type)
xfree (entry_size); xfree (entry_size);
} }
printf_filtered (_(" M_Cached '%s' statistics:\n"), type); gdb_printf (_(" M_Cached '%s' statistics:\n"), type);
printf_filtered (_(" Total object count: %ld\n"), m_total_count); gdb_printf (_(" Total object count: %ld\n"), m_total_count);
printf_filtered (_(" Unique object count: %lu\n"), m_unique_count); gdb_printf (_(" Unique object count: %lu\n"), m_unique_count);
printf_filtered (_(" Percentage of duplicates, by count: ")); gdb_printf (_(" Percentage of duplicates, by count: "));
print_percentage (m_total_count - m_unique_count, m_total_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); gdb_printf (_(" Total object size: %ld\n"), m_total_size);
printf_filtered (_(" Unique object size: %ld\n"), m_unique_size); gdb_printf (_(" Unique object size: %ld\n"), m_unique_size);
printf_filtered (_(" Percentage of duplicates, by size: ")); gdb_printf (_(" Percentage of duplicates, by size: "));
print_percentage (m_total_size - m_unique_size, m_total_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); gdb_printf (_(" Max entry size: %d\n"), max_entry_size);
printf_filtered (_(" Average entry size: ")); gdb_printf (_(" Average entry size: "));
if (m_unique_count > 0) 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 else
/* i18n: "Average entry size: (not applicable)". */ /* i18n: "Average entry size: (not applicable)". */
printf_filtered (_("(not applicable)\n")); gdb_printf (_("(not applicable)\n"));
printf_filtered (_(" Median entry size: %d\n"), median_entry_size); gdb_printf (_(" Median entry size: %d\n"), median_entry_size);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered (_(" \ gdb_printf (_(" \
Total memory used by bcache, including overhead: %ld\n"), Total memory used by bcache, including overhead: %ld\n"),
m_structure_size); m_structure_size);
printf_filtered (_(" Percentage memory overhead: ")); gdb_printf (_(" Percentage memory overhead: "));
print_percentage (m_structure_size - m_unique_size, m_unique_size); 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); print_percentage (m_total_size - m_structure_size, m_total_size);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered (_(" Hash table size: %3d\n"), gdb_printf (_(" Hash table size: %3d\n"),
m_num_buckets); m_num_buckets);
printf_filtered (_(" Hash table expands: %lu\n"), gdb_printf (_(" Hash table expands: %lu\n"),
m_expand_count); m_expand_count);
printf_filtered (_(" Hash table hashes: %lu\n"), gdb_printf (_(" Hash table hashes: %lu\n"),
m_total_count + m_expand_hash_count); m_total_count + m_expand_hash_count);
printf_filtered (_(" Half hash misses: %lu\n"), gdb_printf (_(" Half hash misses: %lu\n"),
m_half_hash_miss_count); m_half_hash_miss_count);
printf_filtered (_(" Hash table population: ")); gdb_printf (_(" Hash table population: "));
print_percentage (occupied_buckets, m_num_buckets); print_percentage (occupied_buckets, m_num_buckets);
printf_filtered (_(" Median hash chain length: %3d\n"), gdb_printf (_(" Median hash chain length: %3d\n"),
median_chain_length); median_chain_length);
printf_filtered (_(" Average hash chain length: ")); gdb_printf (_(" Average hash chain length: "));
if (m_num_buckets > 0) if (m_num_buckets > 0)
printf_filtered ("%3lu\n", m_unique_count / m_num_buckets); gdb_printf ("%3lu\n", m_unique_count / m_num_buckets);
else else
/* i18n: "Average hash chain length: (not applicable)". */ /* i18n: "Average hash chain length: (not applicable)". */
printf_filtered (_("(not applicable)\n")); gdb_printf (_("(not applicable)\n"));
printf_filtered (_(" Maximum hash chain length: %3d\n"), gdb_printf (_(" Maximum hash chain length: %3d\n"),
max_chain_length); max_chain_length);
printf_filtered ("\n"); gdb_printf ("\n");
} }
int int

View file

@ -157,7 +157,7 @@ struct bcache
/* Print statistics on this bcache's memory usage and efficacity at /* Print statistics on this bcache's memory usage and efficacity at
eliminating duplication. TYPE should be a string describing the eliminating duplication. TYPE should be a string describing the
kind of data this bcache holds. Statistics are printed using kind of data this bcache holds. Statistics are printed using
`printf_filtered' and its ilk. */ `gdb_printf' and its ilk. */
void print_statistics (const char *type); void print_statistics (const char *type);
int memory_used (); int memory_used ();

View file

@ -76,7 +76,7 @@ static void
show_bpf_debug (struct ui_file *file, int from_tty, show_bpf_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging of BPF is %s.\n"), value); gdb_printf (file, _("Debugging of BPF is %s.\n"), value);
} }
@ -136,9 +136,9 @@ bpf_gdb_print_insn (bfd_vma memaddr, disassemble_info *info)
static CORE_ADDR static CORE_ADDR
bpf_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) bpf_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Skipping prologue: start_pc=%s\n", "Skipping prologue: start_pc=%s\n",
paddress (gdbarch, start_pc)); paddress (gdbarch, start_pc));
/* XXX: to be completed. */ /* XXX: to be completed. */
return start_pc + 0; return start_pc + 0;
} }
@ -252,8 +252,8 @@ bpf_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
function_call_return_method return_method, function_call_return_method return_method,
CORE_ADDR struct_addr) CORE_ADDR struct_addr)
{ {
fprintf_unfiltered (gdb_stdlog, "Pushing dummy call: sp=%s\n", gdb_printf (gdb_stdlog, "Pushing dummy call: sp=%s\n",
paddress (gdbarch, sp)); paddress (gdbarch, sp));
/* XXX writeme */ /* XXX writeme */
return sp; return sp;
} }

View file

@ -124,7 +124,7 @@ print_one_catch_exec (struct breakpoint *b, struct bp_location **last_loc)
static void static void
print_mention_catch_exec (struct breakpoint *b) print_mention_catch_exec (struct breakpoint *b)
{ {
printf_filtered (_("Catchpoint %d (exec)"), b->number); gdb_printf (_("Catchpoint %d (exec)"), b->number);
} }
/* Implement the "print_recreate" breakpoint_ops method for exec /* Implement the "print_recreate" breakpoint_ops method for exec
@ -133,7 +133,7 @@ print_mention_catch_exec (struct breakpoint *b)
static void static void
print_recreate_catch_exec (struct breakpoint *b, struct ui_file *fp) print_recreate_catch_exec (struct breakpoint *b, struct ui_file *fp)
{ {
fprintf_unfiltered (fp, "catch exec"); gdb_printf (fp, "catch exec");
print_recreate_thread (b, fp); print_recreate_thread (b, fp);
} }

View file

@ -162,8 +162,8 @@ static void
print_mention_catch_fork (struct breakpoint *b) print_mention_catch_fork (struct breakpoint *b)
{ {
struct fork_catchpoint *c = (struct fork_catchpoint *) b; struct fork_catchpoint *c = (struct fork_catchpoint *) b;
printf_filtered (_("Catchpoint %d (%s)"), c->number, gdb_printf (_("Catchpoint %d (%s)"), c->number,
c->is_vfork ? "vfork" : "fork"); c->is_vfork ? "vfork" : "fork");
} }
/* Implement the "print_recreate" breakpoint_ops method for fork /* Implement the "print_recreate" breakpoint_ops method for fork
@ -173,8 +173,8 @@ static void
print_recreate_catch_fork (struct breakpoint *b, struct ui_file *fp) print_recreate_catch_fork (struct breakpoint *b, struct ui_file *fp)
{ {
struct fork_catchpoint *c = (struct fork_catchpoint *) b; struct fork_catchpoint *c = (struct fork_catchpoint *) b;
fprintf_unfiltered (fp, "catch %s", gdb_printf (fp, "catch %s",
c->is_vfork ? "vfork" : "fork"); c->is_vfork ? "vfork" : "fork");
print_recreate_thread (b, fp); print_recreate_thread (b, fp);
} }

View file

@ -193,7 +193,7 @@ signal_catchpoint_print_it (bpstat *bs)
annotate_catchpoint (b->number); annotate_catchpoint (b->number);
maybe_print_thread_hit_breakpoint (uiout); maybe_print_thread_hit_breakpoint (uiout);
printf_filtered (_("Catchpoint %d (signal %s), "), b->number, signal_name); gdb_printf (_("Catchpoint %d (signal %s), "), b->number, signal_name);
return PRINT_SRC_AND_LOC; return PRINT_SRC_AND_LOC;
} }
@ -261,22 +261,22 @@ signal_catchpoint_print_mention (struct breakpoint *b)
if (!c->signals_to_be_caught.empty ()) if (!c->signals_to_be_caught.empty ())
{ {
if (c->signals_to_be_caught.size () > 1) if (c->signals_to_be_caught.size () > 1)
printf_filtered (_("Catchpoint %d (signals"), b->number); gdb_printf (_("Catchpoint %d (signals"), b->number);
else else
printf_filtered (_("Catchpoint %d (signal"), b->number); gdb_printf (_("Catchpoint %d (signal"), b->number);
for (gdb_signal iter : c->signals_to_be_caught) for (gdb_signal iter : c->signals_to_be_caught)
{ {
const char *name = signal_to_name_or_int (iter); const char *name = signal_to_name_or_int (iter);
printf_filtered (" %s", name); gdb_printf (" %s", name);
} }
printf_filtered (")"); gdb_printf (")");
} }
else if (c->catch_all) else if (c->catch_all)
printf_filtered (_("Catchpoint %d (any signal)"), b->number); gdb_printf (_("Catchpoint %d (any signal)"), b->number);
else else
printf_filtered (_("Catchpoint %d (standard signals)"), b->number); gdb_printf (_("Catchpoint %d (standard signals)"), b->number);
} }
/* Implement the "print_recreate" breakpoint_ops method for signal /* Implement the "print_recreate" breakpoint_ops method for signal
@ -287,15 +287,15 @@ signal_catchpoint_print_recreate (struct breakpoint *b, struct ui_file *fp)
{ {
struct signal_catchpoint *c = (struct signal_catchpoint *) b; struct signal_catchpoint *c = (struct signal_catchpoint *) b;
fprintf_unfiltered (fp, "catch signal"); gdb_printf (fp, "catch signal");
if (!c->signals_to_be_caught.empty ()) if (!c->signals_to_be_caught.empty ())
{ {
for (gdb_signal iter : c->signals_to_be_caught) for (gdb_signal iter : c->signals_to_be_caught)
fprintf_unfiltered (fp, " %s", signal_to_name_or_int (iter)); gdb_printf (fp, " %s", signal_to_name_or_int (iter));
} }
else if (c->catch_all) else if (c->catch_all)
fprintf_unfiltered (fp, " all"); gdb_printf (fp, " all");
gdb_putc ('\n', fp); gdb_putc ('\n', fp);
} }

View file

@ -289,9 +289,9 @@ print_mention_catch_syscall (struct breakpoint *b)
if (!c->syscalls_to_be_caught.empty ()) if (!c->syscalls_to_be_caught.empty ())
{ {
if (c->syscalls_to_be_caught.size () > 1) if (c->syscalls_to_be_caught.size () > 1)
printf_filtered (_("Catchpoint %d (syscalls"), b->number); gdb_printf (_("Catchpoint %d (syscalls"), b->number);
else else
printf_filtered (_("Catchpoint %d (syscall"), b->number); gdb_printf (_("Catchpoint %d (syscall"), b->number);
for (int iter : c->syscalls_to_be_caught) for (int iter : c->syscalls_to_be_caught)
{ {
@ -299,15 +299,15 @@ print_mention_catch_syscall (struct breakpoint *b)
get_syscall_by_number (gdbarch, iter, &s); get_syscall_by_number (gdbarch, iter, &s);
if (s.name != NULL) if (s.name != NULL)
printf_filtered (" '%s' [%d]", s.name, s.number); gdb_printf (" '%s' [%d]", s.name, s.number);
else else
printf_filtered (" %d", s.number); gdb_printf (" %d", s.number);
} }
printf_filtered (")"); gdb_printf (")");
} }
else else
printf_filtered (_("Catchpoint %d (any syscall)"), gdb_printf (_("Catchpoint %d (any syscall)"),
b->number); b->number);
} }
/* Implement the "print_recreate" breakpoint_ops method for syscall /* Implement the "print_recreate" breakpoint_ops method for syscall
@ -319,7 +319,7 @@ print_recreate_catch_syscall (struct breakpoint *b, struct ui_file *fp)
struct syscall_catchpoint *c = (struct syscall_catchpoint *) b; struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
struct gdbarch *gdbarch = b->loc->gdbarch; struct gdbarch *gdbarch = b->loc->gdbarch;
fprintf_unfiltered (fp, "catch syscall"); gdb_printf (fp, "catch syscall");
for (int iter : c->syscalls_to_be_caught) for (int iter : c->syscalls_to_be_caught)
{ {
@ -327,9 +327,9 @@ print_recreate_catch_syscall (struct breakpoint *b, struct ui_file *fp)
get_syscall_by_number (gdbarch, iter, &s); get_syscall_by_number (gdbarch, iter, &s);
if (s.name != NULL) if (s.name != NULL)
fprintf_unfiltered (fp, " %s", s.name); gdb_printf (fp, " %s", s.name);
else else
fprintf_unfiltered (fp, " %d", s.number); gdb_printf (fp, " %d", s.number);
} }
print_recreate_thread (b, fp); print_recreate_thread (b, fp);

View file

@ -333,17 +333,17 @@ print_recreate_exception_catchpoint (struct breakpoint *b,
enum exception_event_kind kind = classify_exception_breakpoint (b); enum exception_event_kind kind = classify_exception_breakpoint (b);
bp_temp = b->disposition == disp_del; bp_temp = b->disposition == disp_del;
fprintf_unfiltered (fp, bp_temp ? "tcatch " : "catch "); gdb_printf (fp, bp_temp ? "tcatch " : "catch ");
switch (kind) switch (kind)
{ {
case EX_EVENT_THROW: case EX_EVENT_THROW:
fprintf_unfiltered (fp, "throw"); gdb_printf (fp, "throw");
break; break;
case EX_EVENT_CATCH: case EX_EVENT_CATCH:
fprintf_unfiltered (fp, "catch"); gdb_printf (fp, "catch");
break; break;
case EX_EVENT_RETHROW: case EX_EVENT_RETHROW:
fprintf_unfiltered (fp, "rethrow"); gdb_printf (fp, "rethrow");
break; break;
} }
print_recreate_thread (b, fp); print_recreate_thread (b, fp);

View file

@ -324,10 +324,10 @@ show_can_use_hw_watchpoints (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Debugger's willingness to use " _("Debugger's willingness to use "
"watchpoint hardware is %s.\n"), "watchpoint hardware is %s.\n"),
value); value);
} }
/* If AUTO_BOOLEAN_FALSE, gdb will not attempt to create pending breakpoints. /* If AUTO_BOOLEAN_FALSE, gdb will not attempt to create pending breakpoints.
@ -340,10 +340,10 @@ show_pending_break_support (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Debugger's behavior regarding " _("Debugger's behavior regarding "
"pending breakpoints is %s.\n"), "pending breakpoints is %s.\n"),
value); value);
} }
/* If true, gdb will automatically use hardware breakpoints for breakpoints /* If true, gdb will automatically use hardware breakpoints for breakpoints
@ -356,9 +356,9 @@ show_automatic_hardware_breakpoints (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Automatic usage of hardware breakpoints is %s.\n"), _("Automatic usage of hardware breakpoints is %s.\n"),
value); value);
} }
/* If on, GDB keeps breakpoints inserted even if the inferior is /* If on, GDB keeps breakpoints inserted even if the inferior is
@ -374,8 +374,8 @@ static void
show_always_inserted_mode (struct ui_file *file, int from_tty, show_always_inserted_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Always inserted breakpoint mode is %s.\n"), gdb_printf (file, _("Always inserted breakpoint mode is %s.\n"),
value); value);
} }
/* See breakpoint.h. */ /* See breakpoint.h. */
@ -798,14 +798,14 @@ show_condition_evaluation_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (condition_evaluation_mode == condition_evaluation_auto) if (condition_evaluation_mode == condition_evaluation_auto)
fprintf_filtered (file, gdb_printf (file,
_("Breakpoint condition evaluation " _("Breakpoint condition evaluation "
"mode is %s (currently %s).\n"), "mode is %s (currently %s).\n"),
value, value,
breakpoint_condition_evaluation_mode ()); breakpoint_condition_evaluation_mode ());
else else
fprintf_filtered (file, _("Breakpoint condition evaluation mode is %s.\n"), gdb_printf (file, _("Breakpoint condition evaluation mode is %s.\n"),
value); value);
} }
/* Parse COND_STRING in the context of LOC and set as the condition /* Parse COND_STRING in the context of LOC and set as the condition
@ -828,9 +828,9 @@ set_breakpoint_location_condition (const char *cond_string, bp_location *loc,
{ {
loc->cond = std::move (new_exp); loc->cond = std::move (new_exp);
if (loc->disabled_by_cond && loc->enabled) if (loc->disabled_by_cond && loc->enabled)
printf_filtered (_("Breakpoint %d's condition is now valid at " gdb_printf (_("Breakpoint %d's condition is now valid at "
"location %d, enabling.\n"), "location %d, enabling.\n"),
bp_num, loc_num); bp_num, loc_num);
loc->disabled_by_cond = false; loc->disabled_by_cond = false;
} }
@ -875,9 +875,9 @@ set_breakpoint_condition (struct breakpoint *b, const char *exp,
{ {
loc->cond.reset (); loc->cond.reset ();
if (loc->disabled_by_cond && loc->enabled) if (loc->disabled_by_cond && loc->enabled)
printf_filtered (_("Breakpoint %d's condition is now valid at " gdb_printf (_("Breakpoint %d's condition is now valid at "
"location %d, enabling.\n"), "location %d, enabling.\n"),
b->number, loc_num); b->number, loc_num);
loc->disabled_by_cond = false; loc->disabled_by_cond = false;
loc_num++; loc_num++;
@ -888,7 +888,7 @@ set_breakpoint_condition (struct breakpoint *b, const char *exp,
} }
if (from_tty) if (from_tty)
printf_filtered (_("Breakpoint %d now unconditional.\n"), b->number); gdb_printf (_("Breakpoint %d now unconditional.\n"), b->number);
} }
else else
{ {
@ -2084,10 +2084,10 @@ update_watchpoint (struct watchpoint *b, int reparse)
} }
else if (!within_current_scope) else if (!within_current_scope)
{ {
printf_filtered (_("\ gdb_printf (_("\
Watchpoint %d deleted because the program has left the block\n\ Watchpoint %d deleted because the program has left the block\n\
in which its expression is valid.\n"), in which its expression is valid.\n"),
b->number); b->number);
watchpoint_del_at_next_stop (b); watchpoint_del_at_next_stop (b);
} }
@ -2578,12 +2578,12 @@ insert_bp_location (struct bp_location *bl,
if (mr != nullptr && mr->attrib.mode != MEM_RW) if (mr != nullptr && mr->attrib.mode != MEM_RW)
{ {
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
_("Cannot insert breakpoint %d.\n" _("Cannot insert breakpoint %d.\n"
"Cannot set software breakpoint " "Cannot set software breakpoint "
"at read-only address %s\n"), "at read-only address %s\n"),
bl->owner->number, bl->owner->number,
paddress (bl->gdbarch, bl->address)); paddress (bl->gdbarch, bl->address));
return 1; return 1;
} }
} }
@ -2650,10 +2650,10 @@ insert_bp_location (struct bp_location *bl,
} }
if (bp_excpt.reason != 0) if (bp_excpt.reason != 0)
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Overlay breakpoint %d " "Overlay breakpoint %d "
"failed: in ROM?\n", "failed: in ROM?\n",
bl->owner->number); bl->owner->number);
} }
} }
/* Shall we set a breakpoint at the VMA? */ /* Shall we set a breakpoint at the VMA? */
@ -2714,16 +2714,16 @@ insert_bp_location (struct bp_location *bl,
gdb::observers::breakpoint_modified.notify (bl->owner); gdb::observers::breakpoint_modified.notify (bl->owner);
if (!*disabled_breaks) if (!*disabled_breaks)
{ {
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Cannot insert breakpoint %d.\n", "Cannot insert breakpoint %d.\n",
bl->owner->number); bl->owner->number);
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Temporarily disabling shared " "Temporarily disabling shared "
"library breakpoints:\n"); "library breakpoints:\n");
} }
*disabled_breaks = 1; *disabled_breaks = 1;
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"breakpoint #%d\n", bl->owner->number); "breakpoint #%d\n", bl->owner->number);
return 0; return 0;
} }
else else
@ -2732,13 +2732,13 @@ insert_bp_location (struct bp_location *bl,
{ {
*hw_breakpoint_error = 1; *hw_breakpoint_error = 1;
*hw_bp_error_explained_already = bp_excpt.message != NULL; *hw_bp_error_explained_already = bp_excpt.message != NULL;
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Cannot insert hardware breakpoint %d%s", "Cannot insert hardware breakpoint %d%s",
bl->owner->number, bl->owner->number,
bp_excpt.message ? ":" : ".\n"); bp_excpt.message ? ":" : ".\n");
if (bp_excpt.message != NULL) if (bp_excpt.message != NULL)
fprintf_unfiltered (tmp_error_stream, "%s.\n", gdb_printf (tmp_error_stream, "%s.\n",
bp_excpt.what ()); bp_excpt.what ());
} }
else else
{ {
@ -2748,17 +2748,17 @@ insert_bp_location (struct bp_location *bl,
= memory_error_message (TARGET_XFER_E_IO, = memory_error_message (TARGET_XFER_E_IO,
bl->gdbarch, bl->address); bl->gdbarch, bl->address);
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Cannot insert breakpoint %d.\n" "Cannot insert breakpoint %d.\n"
"%s\n", "%s\n",
bl->owner->number, message.c_str ()); bl->owner->number, message.c_str ());
} }
else else
{ {
fprintf_unfiltered (tmp_error_stream, gdb_printf (tmp_error_stream,
"Cannot insert breakpoint %d: %s\n", "Cannot insert breakpoint %d: %s\n",
bl->owner->number, bl->owner->number,
bp_excpt.what ()); bp_excpt.what ());
} }
} }
return 1; return 1;
@ -3093,9 +3093,9 @@ remove_threaded_breakpoints (struct thread_info *tp, int silent)
{ {
b->disposition = disp_del_at_next_stop; b->disposition = disp_del_at_next_stop;
printf_filtered (_("\ gdb_printf (_("\
Thread-specific breakpoint %d deleted - thread %s no longer in the thread list.\n"), Thread-specific breakpoint %d deleted - thread %s no longer in the thread list.\n"),
b->number, print_thread_id (tp)); b->number, print_thread_id (tp));
/* Hide it from the user. */ /* Hide it from the user. */
b->number = 0; b->number = 0;
@ -5076,8 +5076,8 @@ bpstat_check_watchpoint (bpstat *bs)
SWITCH_THRU_ALL_UIS () SWITCH_THRU_ALL_UIS ()
{ {
printf_filtered (_("Watchpoint %d deleted.\n"), gdb_printf (_("Watchpoint %d deleted.\n"),
b->number); b->number);
} }
watchpoint_del_at_next_stop (b); watchpoint_del_at_next_stop (b);
e = WP_DELETED; e = WP_DELETED;
@ -6740,25 +6740,25 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
if (others > 0) if (others > 0)
{ {
if (others == 1) if (others == 1)
printf_filtered (_("Note: breakpoint ")); gdb_printf (_("Note: breakpoint "));
else /* if (others == ???) */ else /* if (others == ???) */
printf_filtered (_("Note: breakpoints ")); gdb_printf (_("Note: breakpoints "));
for (breakpoint *b : all_breakpoints ()) for (breakpoint *b : all_breakpoints ())
if (user_breakpoint_p (b) && breakpoint_has_pc (b, pspace, pc, section)) if (user_breakpoint_p (b) && breakpoint_has_pc (b, pspace, pc, section))
{ {
others--; others--;
printf_filtered ("%d", b->number); gdb_printf ("%d", b->number);
if (b->thread == -1 && thread != -1) if (b->thread == -1 && thread != -1)
printf_filtered (" (all threads)"); gdb_printf (" (all threads)");
else if (b->thread != -1) else if (b->thread != -1)
printf_filtered (" (thread %d)", b->thread); gdb_printf (" (thread %d)", b->thread);
printf_filtered ("%s%s ", gdb_printf ("%s%s ",
((b->enable_state == bp_disabled ((b->enable_state == bp_disabled
|| b->enable_state == bp_call_disabled) || b->enable_state == bp_call_disabled)
? " (disabled)" ? " (disabled)"
: ""), : ""),
(others > 1) ? "," (others > 1) ? ","
: ((others == 1) ? " and" : "")); : ((others == 1) ? " and" : ""));
} }
current_uiout->message (_("also set at pc %ps.\n"), current_uiout->message (_("also set at pc %ps.\n"),
styled_string (address_style.style (), styled_string (address_style.style (),
@ -7884,8 +7884,8 @@ print_mention_catch_solib (struct breakpoint *b)
{ {
struct solib_catchpoint *self = (struct solib_catchpoint *) b; struct solib_catchpoint *self = (struct solib_catchpoint *) b;
printf_filtered (_("Catchpoint %d (%s)"), b->number, gdb_printf (_("Catchpoint %d (%s)"), b->number,
self->is_load ? "load" : "unload"); self->is_load ? "load" : "unload");
} }
static void static void
@ -7893,12 +7893,12 @@ print_recreate_catch_solib (struct breakpoint *b, struct ui_file *fp)
{ {
struct solib_catchpoint *self = (struct solib_catchpoint *) b; struct solib_catchpoint *self = (struct solib_catchpoint *) b;
fprintf_unfiltered (fp, "%s %s", gdb_printf (fp, "%s %s",
b->disposition == disp_del ? "tcatch" : "catch", b->disposition == disp_del ? "tcatch" : "catch",
self->is_load ? "load" : "unload"); self->is_load ? "load" : "unload");
if (self->regex) if (self->regex)
fprintf_unfiltered (fp, " %s", self->regex.get ()); gdb_printf (fp, " %s", self->regex.get ());
fprintf_unfiltered (fp, "\n"); gdb_printf (fp, "\n");
} }
static struct breakpoint_ops catch_solib_breakpoint_ops; static struct breakpoint_ops catch_solib_breakpoint_ops;
@ -8263,9 +8263,9 @@ handle_automatic_hardware_breakpoints (bp_location *bl)
bl->loc_type = new_type; bl->loc_type = new_type;
if (!said) if (!said)
{ {
printf_filtered (_("Note: automatically using " gdb_printf (_("Note: automatically using "
"hardware breakpoints for " "hardware breakpoints for "
"read-only addresses.\n")); "read-only addresses.\n"));
said = true; said = true;
} }
} }
@ -8517,17 +8517,17 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
t->static_trace_marker_id.assign (p, endp - p); t->static_trace_marker_id.assign (p, endp - p);
printf_filtered (_("Probed static tracepoint " gdb_printf (_("Probed static tracepoint "
"marker \"%s\"\n"), "marker \"%s\"\n"),
t->static_trace_marker_id.c_str ()); t->static_trace_marker_id.c_str ());
} }
else if (target_static_tracepoint_marker_at (sal.pc, &marker)) else if (target_static_tracepoint_marker_at (sal.pc, &marker))
{ {
t->static_trace_marker_id = std::move (marker.str_id); t->static_trace_marker_id = std::move (marker.str_id);
printf_filtered (_("Probed static tracepoint " gdb_printf (_("Probed static tracepoint "
"marker \"%s\"\n"), "marker \"%s\"\n"),
t->static_trace_marker_id.c_str ()); t->static_trace_marker_id.c_str ());
} }
else else
warning (_("Couldn't determine the static " warning (_("Couldn't determine the static "
@ -9299,7 +9299,7 @@ thbreak_command (const char *arg, int from_tty)
static void static void
stop_command (const char *arg, int from_tty) stop_command (const char *arg, int from_tty)
{ {
printf_filtered (_("Specify the type of breakpoint to set.\n\ gdb_printf (_("Specify the type of breakpoint to set.\n\
Usage: stop in <function | address>\n\ Usage: stop in <function | address>\n\
stop at <line>\n")); stop at <line>\n"));
} }
@ -9332,7 +9332,7 @@ stopin_command (const char *arg, int from_tty)
} }
if (badInput) if (badInput)
printf_filtered (_("Usage: stop in <function | address>\n")); gdb_printf (_("Usage: stop in <function | address>\n"));
else else
break_command_1 (arg, 0, from_tty); break_command_1 (arg, 0, from_tty);
} }
@ -9364,7 +9364,7 @@ stopat_command (const char *arg, int from_tty)
} }
if (badInput) if (badInput)
printf_filtered (_("Usage: stop at LINE\n")); gdb_printf (_("Usage: stop at LINE\n"));
else else
break_command_1 (arg, 0, from_tty); break_command_1 (arg, 0, from_tty);
} }
@ -9544,9 +9544,9 @@ print_mention_ranged_breakpoint (struct breakpoint *b)
static void static void
print_recreate_ranged_breakpoint (struct breakpoint *b, struct ui_file *fp) print_recreate_ranged_breakpoint (struct breakpoint *b, struct ui_file *fp)
{ {
fprintf_unfiltered (fp, "break-range %s, %s", gdb_printf (fp, "break-range %s, %s",
event_location_to_string (b->location.get ()), event_location_to_string (b->location.get ()),
event_location_to_string (b->location_range_end.get ())); event_location_to_string (b->location_range_end.get ()));
print_recreate_thread (b, fp); print_recreate_thread (b, fp);
} }
@ -9949,20 +9949,20 @@ print_recreate_watchpoint (struct breakpoint *b, struct ui_file *fp)
{ {
case bp_watchpoint: case bp_watchpoint:
case bp_hardware_watchpoint: case bp_hardware_watchpoint:
fprintf_unfiltered (fp, "watch"); gdb_printf (fp, "watch");
break; break;
case bp_read_watchpoint: case bp_read_watchpoint:
fprintf_unfiltered (fp, "rwatch"); gdb_printf (fp, "rwatch");
break; break;
case bp_access_watchpoint: case bp_access_watchpoint:
fprintf_unfiltered (fp, "awatch"); gdb_printf (fp, "awatch");
break; break;
default: default:
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("Invalid watchpoint type.")); _("Invalid watchpoint type."));
} }
fprintf_unfiltered (fp, " %s", w->exp_string.get ()); gdb_printf (fp, " %s", w->exp_string.get ());
print_recreate_thread (b, fp); print_recreate_thread (b, fp);
} }
@ -10141,21 +10141,21 @@ print_recreate_masked_watchpoint (struct breakpoint *b, struct ui_file *fp)
switch (b->type) switch (b->type)
{ {
case bp_hardware_watchpoint: case bp_hardware_watchpoint:
fprintf_unfiltered (fp, "watch"); gdb_printf (fp, "watch");
break; break;
case bp_read_watchpoint: case bp_read_watchpoint:
fprintf_unfiltered (fp, "rwatch"); gdb_printf (fp, "rwatch");
break; break;
case bp_access_watchpoint: case bp_access_watchpoint:
fprintf_unfiltered (fp, "awatch"); gdb_printf (fp, "awatch");
break; break;
default: default:
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("Invalid hardware watchpoint type.")); _("Invalid hardware watchpoint type."));
} }
fprintf_unfiltered (fp, " %s mask 0x%s", w->exp_string.get (), gdb_printf (fp, " %s mask 0x%s", w->exp_string.get (),
phex (w->hw_wp_mask, sizeof (CORE_ADDR))); phex (w->hw_wp_mask, sizeof (CORE_ADDR)));
print_recreate_thread (b, fp); print_recreate_thread (b, fp);
} }
@ -11057,15 +11057,15 @@ clear_command (const char *arg, int from_tty)
if (from_tty) if (from_tty)
{ {
if (found.size () == 1) if (found.size () == 1)
printf_filtered (_("Deleted breakpoint ")); gdb_printf (_("Deleted breakpoint "));
else else
printf_filtered (_("Deleted breakpoints ")); gdb_printf (_("Deleted breakpoints "));
} }
for (breakpoint *iter : found) for (breakpoint *iter : found)
{ {
if (from_tty) if (from_tty)
printf_filtered ("%d ", iter->number); gdb_printf ("%d ", iter->number);
delete_breakpoint (iter); delete_breakpoint (iter);
} }
if (from_tty) if (from_tty)
@ -11474,9 +11474,9 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
Note that at this point, old_loc->owner is still Note that at this point, old_loc->owner is still
valid, as delete_breakpoint frees the breakpoint valid, as delete_breakpoint frees the breakpoint
only after calling us. */ only after calling us. */
printf_filtered (_("warning: Error removing " gdb_printf (_("warning: Error removing "
"breakpoint %d\n"), "breakpoint %d\n"),
old_loc->owner->number); old_loc->owner->number);
} }
removed = 1; removed = 1;
} }
@ -11720,29 +11720,29 @@ say_where (struct breakpoint *b)
a condition or dprintf arguments. */ a condition or dprintf arguments. */
if (b->extra_string == NULL) if (b->extra_string == NULL)
{ {
printf_filtered (_(" (%s) pending."), gdb_printf (_(" (%s) pending."),
event_location_to_string (b->location.get ())); event_location_to_string (b->location.get ()));
} }
else if (b->type == bp_dprintf) else if (b->type == bp_dprintf)
{ {
printf_filtered (_(" (%s,%s) pending."), gdb_printf (_(" (%s,%s) pending."),
event_location_to_string (b->location.get ()), event_location_to_string (b->location.get ()),
b->extra_string.get ()); b->extra_string.get ());
} }
else else
{ {
printf_filtered (_(" (%s %s) pending."), gdb_printf (_(" (%s %s) pending."),
event_location_to_string (b->location.get ()), event_location_to_string (b->location.get ()),
b->extra_string.get ()); b->extra_string.get ());
} }
} }
else else
{ {
if (opts.addressprint || b->loc->symtab == NULL) if (opts.addressprint || b->loc->symtab == NULL)
printf_filtered (" at %ps", gdb_printf (" at %ps",
styled_string (address_style.style (), styled_string (address_style.style (),
paddress (b->loc->gdbarch, paddress (b->loc->gdbarch,
b->loc->address))); b->loc->address)));
if (b->loc->symtab != NULL) if (b->loc->symtab != NULL)
{ {
/* If there is a single location, we can print the location /* If there is a single location, we can print the location
@ -11751,17 +11751,17 @@ say_where (struct breakpoint *b)
{ {
const char *filename const char *filename
= symtab_to_filename_for_display (b->loc->symtab); = symtab_to_filename_for_display (b->loc->symtab);
printf_filtered (": file %ps, line %d.", gdb_printf (": file %ps, line %d.",
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
filename), filename),
b->loc->line_number); b->loc->line_number);
} }
else else
/* This is not ideal, but each location may have a /* This is not ideal, but each location may have a
different file name, and this at least reflects the different file name, and this at least reflects the
real situation somewhat. */ real situation somewhat. */
printf_filtered (": %s.", gdb_printf (": %s.",
event_location_to_string (b->location.get ())); event_location_to_string (b->location.get ()));
} }
if (b->loc->next) if (b->loc->next)
@ -11770,7 +11770,7 @@ say_where (struct breakpoint *b)
int n = 0; int n = 0;
for (; loc; loc = loc->next) for (; loc; loc = loc->next)
++n; ++n;
printf_filtered (" (%d locations)", n); gdb_printf (" (%d locations)", n);
} }
} }
} }
@ -12072,18 +12072,18 @@ bkpt_print_mention (struct breakpoint *b)
case bp_breakpoint: case bp_breakpoint:
case bp_gnu_ifunc_resolver: case bp_gnu_ifunc_resolver:
if (b->disposition == disp_del) if (b->disposition == disp_del)
printf_filtered (_("Temporary breakpoint")); gdb_printf (_("Temporary breakpoint"));
else else
printf_filtered (_("Breakpoint")); gdb_printf (_("Breakpoint"));
printf_filtered (_(" %d"), b->number); gdb_printf (_(" %d"), b->number);
if (b->type == bp_gnu_ifunc_resolver) if (b->type == bp_gnu_ifunc_resolver)
printf_filtered (_(" at gnu-indirect-function resolver")); gdb_printf (_(" at gnu-indirect-function resolver"));
break; break;
case bp_hardware_breakpoint: case bp_hardware_breakpoint:
printf_filtered (_("Hardware assisted breakpoint %d"), b->number); gdb_printf (_("Hardware assisted breakpoint %d"), b->number);
break; break;
case bp_dprintf: case bp_dprintf:
printf_filtered (_("Dprintf %d"), b->number); gdb_printf (_("Dprintf %d"), b->number);
break; break;
} }
@ -12094,25 +12094,25 @@ static void
bkpt_print_recreate (struct breakpoint *tp, struct ui_file *fp) bkpt_print_recreate (struct breakpoint *tp, struct ui_file *fp)
{ {
if (tp->type == bp_breakpoint && tp->disposition == disp_del) if (tp->type == bp_breakpoint && tp->disposition == disp_del)
fprintf_unfiltered (fp, "tbreak"); gdb_printf (fp, "tbreak");
else if (tp->type == bp_breakpoint) else if (tp->type == bp_breakpoint)
fprintf_unfiltered (fp, "break"); gdb_printf (fp, "break");
else if (tp->type == bp_hardware_breakpoint else if (tp->type == bp_hardware_breakpoint
&& tp->disposition == disp_del) && tp->disposition == disp_del)
fprintf_unfiltered (fp, "thbreak"); gdb_printf (fp, "thbreak");
else if (tp->type == bp_hardware_breakpoint) else if (tp->type == bp_hardware_breakpoint)
fprintf_unfiltered (fp, "hbreak"); gdb_printf (fp, "hbreak");
else else
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("unhandled breakpoint type %d"), (int) tp->type); _("unhandled breakpoint type %d"), (int) tp->type);
fprintf_unfiltered (fp, " %s", gdb_printf (fp, " %s",
event_location_to_string (tp->location.get ())); event_location_to_string (tp->location.get ()));
/* Print out extra_string if this breakpoint is pending. It might /* Print out extra_string if this breakpoint is pending. It might
contain, for example, conditions that were set by the user. */ contain, for example, conditions that were set by the user. */
if (tp->loc == NULL && tp->extra_string != NULL) if (tp->loc == NULL && tp->extra_string != NULL)
fprintf_unfiltered (fp, " %s", tp->extra_string.get ()); gdb_printf (fp, " %s", tp->extra_string.get ());
print_recreate_thread (tp, fp); print_recreate_thread (tp, fp);
} }
@ -12217,29 +12217,29 @@ internal_bkpt_print_it (bpstat *bs)
case bp_thread_event: case bp_thread_event:
/* Not sure how we will get here. /* Not sure how we will get here.
GDB should not stop for these breakpoints. */ GDB should not stop for these breakpoints. */
printf_filtered (_("Thread Event Breakpoint: gdb should not stop!\n")); gdb_printf (_("Thread Event Breakpoint: gdb should not stop!\n"));
break; break;
case bp_overlay_event: case bp_overlay_event:
/* By analogy with the thread event, GDB should not stop for these. */ /* By analogy with the thread event, GDB should not stop for these. */
printf_filtered (_("Overlay Event Breakpoint: gdb should not stop!\n")); gdb_printf (_("Overlay Event Breakpoint: gdb should not stop!\n"));
break; break;
case bp_longjmp_master: case bp_longjmp_master:
/* These should never be enabled. */ /* These should never be enabled. */
printf_filtered (_("Longjmp Master Breakpoint: gdb should not stop!\n")); gdb_printf (_("Longjmp Master Breakpoint: gdb should not stop!\n"));
break; break;
case bp_std_terminate_master: case bp_std_terminate_master:
/* These should never be enabled. */ /* These should never be enabled. */
printf_filtered (_("std::terminate Master Breakpoint: " gdb_printf (_("std::terminate Master Breakpoint: "
"gdb should not stop!\n")); "gdb should not stop!\n"));
break; break;
case bp_exception_master: case bp_exception_master:
/* These should never be enabled. */ /* These should never be enabled. */
printf_filtered (_("Exception Master Breakpoint: " gdb_printf (_("Exception Master Breakpoint: "
"gdb should not stop!\n")); "gdb should not stop!\n"));
break; break;
} }
@ -12387,16 +12387,16 @@ tracepoint_print_mention (struct breakpoint *b)
switch (b->type) switch (b->type)
{ {
case bp_tracepoint: case bp_tracepoint:
printf_filtered (_("Tracepoint")); gdb_printf (_("Tracepoint"));
printf_filtered (_(" %d"), b->number); gdb_printf (_(" %d"), b->number);
break; break;
case bp_fast_tracepoint: case bp_fast_tracepoint:
printf_filtered (_("Fast tracepoint")); gdb_printf (_("Fast tracepoint"));
printf_filtered (_(" %d"), b->number); gdb_printf (_(" %d"), b->number);
break; break;
case bp_static_tracepoint: case bp_static_tracepoint:
printf_filtered (_("Static tracepoint")); gdb_printf (_("Static tracepoint"));
printf_filtered (_(" %d"), b->number); gdb_printf (_(" %d"), b->number);
break; break;
default: default:
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
@ -12412,21 +12412,21 @@ tracepoint_print_recreate (struct breakpoint *self, struct ui_file *fp)
struct tracepoint *tp = (struct tracepoint *) self; struct tracepoint *tp = (struct tracepoint *) self;
if (self->type == bp_fast_tracepoint) if (self->type == bp_fast_tracepoint)
fprintf_unfiltered (fp, "ftrace"); gdb_printf (fp, "ftrace");
else if (self->type == bp_static_tracepoint) else if (self->type == bp_static_tracepoint)
fprintf_unfiltered (fp, "strace"); gdb_printf (fp, "strace");
else if (self->type == bp_tracepoint) else if (self->type == bp_tracepoint)
fprintf_unfiltered (fp, "trace"); gdb_printf (fp, "trace");
else else
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("unhandled tracepoint type %d"), (int) self->type); _("unhandled tracepoint type %d"), (int) self->type);
fprintf_unfiltered (fp, " %s", gdb_printf (fp, " %s",
event_location_to_string (self->location.get ())); event_location_to_string (self->location.get ()));
print_recreate_thread (self, fp); print_recreate_thread (self, fp);
if (tp->pass_count) if (tp->pass_count)
fprintf_unfiltered (fp, " passcount %d\n", tp->pass_count); gdb_printf (fp, " passcount %d\n", tp->pass_count);
} }
static void static void
@ -12519,9 +12519,9 @@ dprintf_re_set (struct breakpoint *b)
static void static void
dprintf_print_recreate (struct breakpoint *tp, struct ui_file *fp) dprintf_print_recreate (struct breakpoint *tp, struct ui_file *fp)
{ {
fprintf_unfiltered (fp, "dprintf %s,%s", gdb_printf (fp, "dprintf %s,%s",
event_location_to_string (tp->location.get ()), event_location_to_string (tp->location.get ()),
tp->extra_string.get ()); tp->extra_string.get ());
print_recreate_thread (tp, fp); print_recreate_thread (tp, fp);
} }
@ -13072,10 +13072,10 @@ update_breakpoint_locations (struct breakpoint *b,
/* Ranged breakpoints have only one start location and one end /* Ranged breakpoints have only one start location and one end
location. */ location. */
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("Could not reset ranged breakpoint %d: " _("Could not reset ranged breakpoint %d: "
"multiple locations found\n"), "multiple locations found\n"),
b->number); b->number);
return; return;
} }
@ -13455,8 +13455,8 @@ set_ignore_count (int bptnum, int count, int from_tty)
if (is_tracepoint (b)) if (is_tracepoint (b))
{ {
if (from_tty && count != 0) if (from_tty && count != 0)
printf_filtered (_("Ignore count ignored for tracepoint %d."), gdb_printf (_("Ignore count ignored for tracepoint %d."),
bptnum); bptnum);
return; return;
} }
@ -13464,16 +13464,16 @@ set_ignore_count (int bptnum, int count, int from_tty)
if (from_tty) if (from_tty)
{ {
if (count == 0) if (count == 0)
printf_filtered (_("Will stop next time " gdb_printf (_("Will stop next time "
"breakpoint %d is reached."), "breakpoint %d is reached."),
bptnum); bptnum);
else if (count == 1) else if (count == 1)
printf_filtered (_("Will ignore next crossing of breakpoint %d."), gdb_printf (_("Will ignore next crossing of breakpoint %d."),
bptnum); bptnum);
else else
printf_filtered (_("Will ignore next %d " gdb_printf (_("Will ignore next %d "
"crossings of breakpoint %d."), "crossings of breakpoint %d."),
count, bptnum); count, bptnum);
} }
gdb::observers::breakpoint_modified.notify (b); gdb::observers::breakpoint_modified.notify (b);
return; return;
@ -13503,7 +13503,7 @@ ignore_command (const char *args, int from_tty)
longest_to_int (value_as_long (parse_and_eval (p))), longest_to_int (value_as_long (parse_and_eval (p))),
from_tty); from_tty);
if (from_tty) if (from_tty)
printf_filtered ("\n"); gdb_printf ("\n");
} }
@ -13533,7 +13533,7 @@ map_breakpoint_number_range (std::pair<int, int> bp_num_range,
break; break;
} }
if (!match) if (!match)
printf_filtered (_("No breakpoint number %d.\n"), i); gdb_printf (_("No breakpoint number %d.\n"), i);
} }
} }
} }
@ -14354,8 +14354,8 @@ trace_pass_set_count (struct tracepoint *tp, int count, int from_tty)
tp->pass_count = count; tp->pass_count = count;
gdb::observers::breakpoint_modified.notify (tp); gdb::observers::breakpoint_modified.notify (tp);
if (from_tty) if (from_tty)
printf_filtered (_("Setting tracepoint %d's passcount to %d\n"), gdb_printf (_("Setting tracepoint %d's passcount to %d\n"),
tp->number, count); tp->number, count);
} }
/* Set passcount for tracepoint. /* Set passcount for tracepoint.
@ -14460,10 +14460,10 @@ get_tracepoint_by_number (const char **arg,
if (tpnum <= 0) if (tpnum <= 0)
{ {
if (instring && *instring) if (instring && *instring)
printf_filtered (_("bad tracepoint number at or near '%s'\n"), gdb_printf (_("bad tracepoint number at or near '%s'\n"),
instring); instring);
else else
printf_filtered (_("No previous tracepoint\n")); gdb_printf (_("No previous tracepoint\n"));
return NULL; return NULL;
} }
@ -14471,7 +14471,7 @@ get_tracepoint_by_number (const char **arg,
if (t->number == tpnum) if (t->number == tpnum)
return (struct tracepoint *) t; return (struct tracepoint *) t;
printf_filtered ("No tracepoint number %d.\n", tpnum); gdb_printf ("No tracepoint number %d.\n", tpnum);
return NULL; return NULL;
} }
@ -14479,12 +14479,12 @@ void
print_recreate_thread (struct breakpoint *b, struct ui_file *fp) print_recreate_thread (struct breakpoint *b, struct ui_file *fp)
{ {
if (b->thread != -1) if (b->thread != -1)
fprintf_unfiltered (fp, " thread %d", b->thread); gdb_printf (fp, " thread %d", b->thread);
if (b->task != 0) if (b->task != 0)
fprintf_unfiltered (fp, " task %d", b->task); gdb_printf (fp, " task %d", b->task);
fprintf_unfiltered (fp, "\n"); gdb_printf (fp, "\n");
} }
/* Save information on user settable breakpoints (watchpoints, etc) to /* Save information on user settable breakpoints (watchpoints, etc) to
@ -14606,7 +14606,7 @@ save_breakpoints (const char *filename, int from_tty,
fp.printf ("set default-collect %s\n", default_collect.c_str ()); fp.printf ("set default-collect %s\n", default_collect.c_str ());
if (from_tty) if (from_tty)
printf_filtered (_("Saved to file '%s'.\n"), expanded_filename.get ()); gdb_printf (_("Saved to file '%s'.\n"), expanded_filename.get ());
} }
/* The `save breakpoints' command. */ /* The `save breakpoints' command. */

View file

@ -204,10 +204,10 @@ void
bsd_kvm_target::files_info () bsd_kvm_target::files_info ()
{ {
if (bsd_kvm_corefile && strcmp (bsd_kvm_corefile, _PATH_MEM) != 0) if (bsd_kvm_corefile && strcmp (bsd_kvm_corefile, _PATH_MEM) != 0)
printf_filtered (_("\tUsing the kernel crash dump %s.\n"), gdb_printf (_("\tUsing the kernel crash dump %s.\n"),
bsd_kvm_corefile); bsd_kvm_corefile);
else else
printf_filtered (_("\tUsing the currently running kernel.\n")); gdb_printf (_("\tUsing the currently running kernel.\n"));
} }
/* Fetch process control block at address PADDR. */ /* Fetch process control block at address PADDR. */

View file

@ -62,8 +62,8 @@ static void btrace_add_pc (struct thread_info *tp);
do \ do \
{ \ { \
if (record_debug != 0) \ if (record_debug != 0) \
fprintf_unfiltered (gdb_stdlog, \ gdb_printf (gdb_stdlog, \
"[btrace] " msg "\n", ##args); \ "[btrace] " msg "\n", ##args); \
} \ } \
while (0) while (0)
@ -2852,122 +2852,122 @@ pt_print_packet (const struct pt_packet *packet)
switch (packet->type) switch (packet->type)
{ {
default: default:
printf_filtered (("[??: %x]"), packet->type); gdb_printf (("[??: %x]"), packet->type);
break; break;
case ppt_psb: case ppt_psb:
printf_filtered (("psb")); gdb_printf (("psb"));
break; break;
case ppt_psbend: case ppt_psbend:
printf_filtered (("psbend")); gdb_printf (("psbend"));
break; break;
case ppt_pad: case ppt_pad:
printf_filtered (("pad")); gdb_printf (("pad"));
break; break;
case ppt_tip: case ppt_tip:
printf_filtered (("tip %u: 0x%" PRIx64 ""), gdb_printf (("tip %u: 0x%" PRIx64 ""),
packet->payload.ip.ipc, packet->payload.ip.ipc,
packet->payload.ip.ip); packet->payload.ip.ip);
break; break;
case ppt_tip_pge: case ppt_tip_pge:
printf_filtered (("tip.pge %u: 0x%" PRIx64 ""), gdb_printf (("tip.pge %u: 0x%" PRIx64 ""),
packet->payload.ip.ipc, packet->payload.ip.ipc,
packet->payload.ip.ip); packet->payload.ip.ip);
break; break;
case ppt_tip_pgd: case ppt_tip_pgd:
printf_filtered (("tip.pgd %u: 0x%" PRIx64 ""), gdb_printf (("tip.pgd %u: 0x%" PRIx64 ""),
packet->payload.ip.ipc, packet->payload.ip.ipc,
packet->payload.ip.ip); packet->payload.ip.ip);
break; break;
case ppt_fup: case ppt_fup:
printf_filtered (("fup %u: 0x%" PRIx64 ""), gdb_printf (("fup %u: 0x%" PRIx64 ""),
packet->payload.ip.ipc, packet->payload.ip.ipc,
packet->payload.ip.ip); packet->payload.ip.ip);
break; break;
case ppt_tnt_8: case ppt_tnt_8:
printf_filtered (("tnt-8 %u: 0x%" PRIx64 ""), gdb_printf (("tnt-8 %u: 0x%" PRIx64 ""),
packet->payload.tnt.bit_size, packet->payload.tnt.bit_size,
packet->payload.tnt.payload); packet->payload.tnt.payload);
break; break;
case ppt_tnt_64: case ppt_tnt_64:
printf_filtered (("tnt-64 %u: 0x%" PRIx64 ""), gdb_printf (("tnt-64 %u: 0x%" PRIx64 ""),
packet->payload.tnt.bit_size, packet->payload.tnt.bit_size,
packet->payload.tnt.payload); packet->payload.tnt.payload);
break; break;
case ppt_pip: case ppt_pip:
printf_filtered (("pip %" PRIx64 "%s"), packet->payload.pip.cr3, gdb_printf (("pip %" PRIx64 "%s"), packet->payload.pip.cr3,
packet->payload.pip.nr ? (" nr") : ("")); packet->payload.pip.nr ? (" nr") : (""));
break; break;
case ppt_tsc: case ppt_tsc:
printf_filtered (("tsc %" PRIx64 ""), packet->payload.tsc.tsc); gdb_printf (("tsc %" PRIx64 ""), packet->payload.tsc.tsc);
break; break;
case ppt_cbr: case ppt_cbr:
printf_filtered (("cbr %u"), packet->payload.cbr.ratio); gdb_printf (("cbr %u"), packet->payload.cbr.ratio);
break; break;
case ppt_mode: case ppt_mode:
switch (packet->payload.mode.leaf) switch (packet->payload.mode.leaf)
{ {
default: default:
printf_filtered (("mode %u"), packet->payload.mode.leaf); gdb_printf (("mode %u"), packet->payload.mode.leaf);
break; break;
case pt_mol_exec: case pt_mol_exec:
printf_filtered (("mode.exec%s%s"), gdb_printf (("mode.exec%s%s"),
packet->payload.mode.bits.exec.csl packet->payload.mode.bits.exec.csl
? (" cs.l") : (""), ? (" cs.l") : (""),
packet->payload.mode.bits.exec.csd packet->payload.mode.bits.exec.csd
? (" cs.d") : ("")); ? (" cs.d") : (""));
break; break;
case pt_mol_tsx: case pt_mol_tsx:
printf_filtered (("mode.tsx%s%s"), gdb_printf (("mode.tsx%s%s"),
packet->payload.mode.bits.tsx.intx packet->payload.mode.bits.tsx.intx
? (" intx") : (""), ? (" intx") : (""),
packet->payload.mode.bits.tsx.abrt packet->payload.mode.bits.tsx.abrt
? (" abrt") : ("")); ? (" abrt") : (""));
break; break;
} }
break; break;
case ppt_ovf: case ppt_ovf:
printf_filtered (("ovf")); gdb_printf (("ovf"));
break; break;
case ppt_stop: case ppt_stop:
printf_filtered (("stop")); gdb_printf (("stop"));
break; break;
case ppt_vmcs: case ppt_vmcs:
printf_filtered (("vmcs %" PRIx64 ""), packet->payload.vmcs.base); gdb_printf (("vmcs %" PRIx64 ""), packet->payload.vmcs.base);
break; break;
case ppt_tma: case ppt_tma:
printf_filtered (("tma %x %x"), packet->payload.tma.ctc, gdb_printf (("tma %x %x"), packet->payload.tma.ctc,
packet->payload.tma.fc); packet->payload.tma.fc);
break; break;
case ppt_mtc: case ppt_mtc:
printf_filtered (("mtc %x"), packet->payload.mtc.ctc); gdb_printf (("mtc %x"), packet->payload.mtc.ctc);
break; break;
case ppt_cyc: case ppt_cyc:
printf_filtered (("cyc %" PRIx64 ""), packet->payload.cyc.value); gdb_printf (("cyc %" PRIx64 ""), packet->payload.cyc.value);
break; break;
case ppt_mnt: case ppt_mnt:
printf_filtered (("mnt %" PRIx64 ""), packet->payload.mnt.payload); gdb_printf (("mnt %" PRIx64 ""), packet->payload.mnt.payload);
break; break;
} }
} }
@ -3149,9 +3149,9 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo,
{ {
const btrace_block &block = blocks.at (blk); const btrace_block &block = blocks.at (blk);
printf_filtered ("%u\tbegin: %s, end: %s\n", blk, gdb_printf ("%u\tbegin: %s, end: %s\n", blk,
core_addr_to_string_nz (block.begin), core_addr_to_string_nz (block.begin),
core_addr_to_string_nz (block.end)); core_addr_to_string_nz (block.end));
} }
btinfo->maint.variant.bts.packet_history.begin = begin; btinfo->maint.variant.bts.packet_history.begin = begin;
@ -3170,15 +3170,15 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo,
{ {
const struct btrace_pt_packet &packet = packets.at (pkt); const struct btrace_pt_packet &packet = packets.at (pkt);
printf_filtered ("%u\t", pkt); gdb_printf ("%u\t", pkt);
printf_filtered ("0x%" PRIx64 "\t", packet.offset); gdb_printf ("0x%" PRIx64 "\t", packet.offset);
if (packet.errcode == pte_ok) if (packet.errcode == pte_ok)
pt_print_packet (&packet.packet); pt_print_packet (&packet.packet);
else else
printf_filtered ("[error: %s]", pt_errstr (packet.errcode)); gdb_printf ("[error: %s]", pt_errstr (packet.errcode));
printf_filtered ("\n"); gdb_printf ("\n");
} }
btinfo->maint.variant.pt.packet_history.begin = begin; btinfo->maint.variant.pt.packet_history.begin = begin;
@ -3256,7 +3256,7 @@ maint_btrace_packet_history_cmd (const char *arg, int from_tty)
btrace_maint_update_packets (btinfo, &begin, &end, &from, &to); btrace_maint_update_packets (btinfo, &begin, &end, &from, &to);
if (begin == end) if (begin == end)
{ {
printf_filtered (_("No trace.\n")); gdb_printf (_("No trace.\n"));
return; return;
} }
@ -3398,8 +3398,8 @@ maint_info_btrace_cmd (const char *args, int from_tty)
if (conf == NULL) if (conf == NULL)
error (_("No btrace configuration.")); error (_("No btrace configuration."));
printf_filtered (_("Format: %s.\n"), gdb_printf (_("Format: %s.\n"),
btrace_format_string (conf->format)); btrace_format_string (conf->format));
switch (conf->format) switch (conf->format)
{ {
@ -3407,8 +3407,8 @@ maint_info_btrace_cmd (const char *args, int from_tty)
break; break;
case BTRACE_FORMAT_BTS: case BTRACE_FORMAT_BTS:
printf_filtered (_("Number of packets: %zu.\n"), gdb_printf (_("Number of packets: %zu.\n"),
btinfo->data.variant.bts.blocks->size ()); btinfo->data.variant.bts.blocks->size ());
break; break;
#if defined (HAVE_LIBIPT) #if defined (HAVE_LIBIPT)
@ -3417,14 +3417,14 @@ maint_info_btrace_cmd (const char *args, int from_tty)
struct pt_version version; struct pt_version version;
version = pt_library_version (); version = pt_library_version ();
printf_filtered (_("Version: %u.%u.%u%s.\n"), version.major, gdb_printf (_("Version: %u.%u.%u%s.\n"), version.major,
version.minor, version.build, version.minor, version.build,
version.ext != NULL ? version.ext : ""); version.ext != NULL ? version.ext : "");
btrace_maint_update_pt_packets (btinfo); btrace_maint_update_pt_packets (btinfo);
printf_filtered (_("Number of packets: %zu.\n"), gdb_printf (_("Number of packets: %zu.\n"),
((btinfo->maint.variant.pt.packets == nullptr) ((btinfo->maint.variant.pt.packets == nullptr)
? 0 : btinfo->maint.variant.pt.packets->size ())); ? 0 : btinfo->maint.variant.pt.packets->size ()));
} }
break; break;
#endif /* defined (HAVE_LIBIPT) */ #endif /* defined (HAVE_LIBIPT) */
@ -3438,7 +3438,7 @@ show_maint_btrace_pt_skip_pad (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, _("Skip PAD packets is %s.\n"), value); gdb_printf (file, _("Skip PAD packets is %s.\n"), value);
} }

View file

@ -76,7 +76,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
{ {
fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ()); gdb_printf (gdb_stdlog, _(" Trying %s..."), link.c_str ());
gdb_flush (gdb_stdlog); gdb_flush (gdb_stdlog);
} }
@ -94,8 +94,8 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (filename == NULL) if (filename == NULL)
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" no, unable to compute real path\n")); _(" no, unable to compute real path\n"));
return {}; return {};
} }
@ -106,7 +106,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (debug_bfd == NULL) if (debug_bfd == NULL)
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n")); gdb_printf (gdb_stdlog, _(" no, unable to open.\n"));
return {}; return {};
} }
@ -114,13 +114,13 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (!build_id_verify (debug_bfd.get(), build_id_len, build_id)) if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n")); gdb_printf (gdb_stdlog, _(" no, build-id does not match.\n"));
return {}; return {};
} }
if (separate_debug_file_debug) if (separate_debug_file_debug)
fprintf_unfiltered (gdb_stdlog, _(" yes!\n")); gdb_printf (gdb_stdlog, _(" yes!\n"));
return debug_bfd; return debug_bfd;
} }
@ -210,9 +210,9 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
if (build_id != NULL) if (build_id != NULL)
{ {
if (separate_debug_file_debug) if (separate_debug_file_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_("\nLooking for separate debug info (build-id) for " _("\nLooking for separate debug info (build-id) for "
"%s\n"), objfile_name (objfile)); "%s\n"), objfile_name (objfile));
gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size,
build_id->data)); build_id->data));

View file

@ -205,14 +205,14 @@ c_print_typedef (struct type *type,
struct ui_file *stream) struct ui_file *stream)
{ {
type = check_typedef (type); type = check_typedef (type);
fprintf_filtered (stream, "typedef "); gdb_printf (stream, "typedef ");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
if ((new_symbol->type ())->name () == 0 if ((new_symbol->type ())->name () == 0
|| strcmp ((new_symbol->type ())->name (), || strcmp ((new_symbol->type ())->name (),
new_symbol->linkage_name ()) != 0 new_symbol->linkage_name ()) != 0
|| new_symbol->type ()->code () == TYPE_CODE_TYPEDEF) || new_symbol->type ()->code () == TYPE_CODE_TYPEDEF)
fprintf_filtered (stream, " %s", new_symbol->print_name ()); gdb_printf (stream, " %s", new_symbol->print_name ());
fprintf_filtered (stream, ";"); gdb_printf (stream, ";");
} }
/* If TYPE is a derived type, then print out derivation information. /* If TYPE is a derived type, then print out derivation information.
@ -252,16 +252,16 @@ cp_type_print_derivation_info (struct ui_file *stream,
{ {
stream->wrap_here (8); stream->wrap_here (8);
gdb_puts (i == 0 ? ": " : ", ", stream); gdb_puts (i == 0 ? ": " : ", ", stream);
fprintf_filtered (stream, "%s%s ", gdb_printf (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i) BASETYPE_VIA_PUBLIC (type, i)
? "public" : (TYPE_FIELD_PROTECTED (type, i) ? "public" : (TYPE_FIELD_PROTECTED (type, i)
? "protected" : "private"), ? "protected" : "private"),
BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : ""); BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
name = TYPE_BASECLASS (type, i)->name (); name = TYPE_BASECLASS (type, i)->name ();
if (name) if (name)
print_name_maybe_canonical (name, flags, stream); print_name_maybe_canonical (name, flags, stream);
else else
fprintf_filtered (stream, "(null)"); gdb_printf (stream, "(null)");
} }
if (i > 0) if (i > 0)
{ {
@ -306,20 +306,20 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
c_print_type (arg.type (), "", stream, 0, 0, flags); c_print_type (arg.type (), "", stream, 0, 0, flags);
if (i == nargs && varargs) if (i == nargs && varargs)
fprintf_filtered (stream, ", ..."); gdb_printf (stream, ", ...");
else if (i < nargs) else if (i < nargs)
{ {
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
stream->wrap_here (8); stream->wrap_here (8);
} }
} }
} }
else if (varargs) else if (varargs)
fprintf_filtered (stream, "..."); gdb_printf (stream, "...");
else if (language == language_cplus) else if (language == language_cplus)
fprintf_filtered (stream, "void"); gdb_printf (stream, "void");
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
/* For non-static methods, read qualifiers from the type of /* For non-static methods, read qualifiers from the type of
THIS. */ THIS. */
@ -332,18 +332,18 @@ cp_type_print_method_args (struct type *mtype, const char *prefix,
domain = TYPE_TARGET_TYPE (args[0].type ()); domain = TYPE_TARGET_TYPE (args[0].type ());
if (TYPE_CONST (domain)) if (TYPE_CONST (domain))
fprintf_filtered (stream, " const"); gdb_printf (stream, " const");
if (TYPE_VOLATILE (domain)) if (TYPE_VOLATILE (domain))
fprintf_filtered (stream, " volatile"); gdb_printf (stream, " volatile");
if (TYPE_RESTRICT (domain)) if (TYPE_RESTRICT (domain))
fprintf_filtered (stream, (language == language_cplus gdb_printf (stream, (language == language_cplus
? " __restrict__" ? " __restrict__"
: " restrict")); : " restrict"));
if (TYPE_ATOMIC (domain)) if (TYPE_ATOMIC (domain))
fprintf_filtered (stream, " _Atomic"); gdb_printf (stream, " _Atomic");
} }
} }
@ -385,7 +385,7 @@ c_type_print_varspec_prefix (struct type *type,
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
stream, show, 1, 1, language, flags, stream, show, 1, 1, language, flags,
podata); podata);
fprintf_filtered (stream, "*"); gdb_printf (stream, "*");
c_type_print_modifier (type, stream, 1, need_post_space, language); c_type_print_modifier (type, stream, 1, need_post_space, language);
break; break;
@ -399,14 +399,14 @@ c_type_print_varspec_prefix (struct type *type,
c_type_print_base_1 (TYPE_SELF_TYPE (type), c_type_print_base_1 (TYPE_SELF_TYPE (type),
stream, -1, passed_a_ptr, language, flags, stream, -1, passed_a_ptr, language, flags,
podata); podata);
fprintf_filtered (stream, "::*"); gdb_printf (stream, "::*");
break; break;
case TYPE_CODE_METHODPTR: case TYPE_CODE_METHODPTR:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
stream, show, 0, 0, language, flags, stream, show, 0, 0, language, flags,
podata); podata);
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
name = TYPE_SELF_TYPE (type)->name (); name = TYPE_SELF_TYPE (type)->name ();
if (name) if (name)
print_name_maybe_canonical (name, flags, stream); print_name_maybe_canonical (name, flags, stream);
@ -414,7 +414,7 @@ c_type_print_varspec_prefix (struct type *type,
c_type_print_base_1 (TYPE_SELF_TYPE (type), c_type_print_base_1 (TYPE_SELF_TYPE (type),
stream, -1, passed_a_ptr, language, flags, stream, -1, passed_a_ptr, language, flags,
podata); podata);
fprintf_filtered (stream, "::*"); gdb_printf (stream, "::*");
break; break;
case TYPE_CODE_REF: case TYPE_CODE_REF:
@ -422,7 +422,7 @@ c_type_print_varspec_prefix (struct type *type,
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
stream, show, 1, 0, language, flags, stream, show, 1, 0, language, flags,
podata); podata);
fprintf_filtered (stream, type->code () == TYPE_CODE_REF ? "&" : "&&"); gdb_printf (stream, type->code () == TYPE_CODE_REF ? "&" : "&&");
c_type_print_modifier (type, stream, 1, need_post_space, language); c_type_print_modifier (type, stream, 1, need_post_space, language);
break; break;
@ -432,7 +432,7 @@ c_type_print_varspec_prefix (struct type *type,
stream, show, 0, 0, language, flags, stream, show, 0, 0, language, flags,
podata); podata);
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
break; break;
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
@ -440,7 +440,7 @@ c_type_print_varspec_prefix (struct type *type,
stream, show, 0, need_post_space, stream, show, 0, need_post_space,
language, flags, podata); language, flags, podata);
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
break; break;
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
@ -497,34 +497,34 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
if (TYPE_CONST (type) && !TYPE_IS_REFERENCE (type)) if (TYPE_CONST (type) && !TYPE_IS_REFERENCE (type))
{ {
if (need_pre_space) if (need_pre_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
fprintf_filtered (stream, "const"); gdb_printf (stream, "const");
did_print_modifier = 1; did_print_modifier = 1;
} }
if (TYPE_VOLATILE (type)) if (TYPE_VOLATILE (type))
{ {
if (did_print_modifier || need_pre_space) if (did_print_modifier || need_pre_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
fprintf_filtered (stream, "volatile"); gdb_printf (stream, "volatile");
did_print_modifier = 1; did_print_modifier = 1;
} }
if (TYPE_RESTRICT (type)) if (TYPE_RESTRICT (type))
{ {
if (did_print_modifier || need_pre_space) if (did_print_modifier || need_pre_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
fprintf_filtered (stream, (language == language_cplus gdb_printf (stream, (language == language_cplus
? "__restrict__" ? "__restrict__"
: "restrict")); : "restrict"));
did_print_modifier = 1; did_print_modifier = 1;
} }
if (TYPE_ATOMIC (type)) if (TYPE_ATOMIC (type))
{ {
if (did_print_modifier || need_pre_space) if (did_print_modifier || need_pre_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
fprintf_filtered (stream, "_Atomic"); gdb_printf (stream, "_Atomic");
did_print_modifier = 1; did_print_modifier = 1;
} }
@ -534,13 +534,13 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
if (address_space_id) if (address_space_id)
{ {
if (did_print_modifier || need_pre_space) if (did_print_modifier || need_pre_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
fprintf_filtered (stream, "@%s", address_space_id); gdb_printf (stream, "@%s", address_space_id);
did_print_modifier = 1; did_print_modifier = 1;
} }
if (did_print_modifier && need_post_space) if (did_print_modifier && need_post_space)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
} }
@ -561,7 +561,7 @@ c_type_print_args (struct type *type, struct ui_file *stream,
int i; int i;
int printed_any = 0; int printed_any = 0;
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
for (i = 0; i < type->num_fields (); i++) for (i = 0; i < type->num_fields (); i++)
{ {
@ -572,7 +572,7 @@ c_type_print_args (struct type *type, struct ui_file *stream,
if (printed_any) if (printed_any)
{ {
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
stream->wrap_here (4); stream->wrap_here (4);
} }
@ -601,16 +601,16 @@ c_type_print_args (struct type *type, struct ui_file *stream,
represents unprototyped (K&R style) C functions. */ represents unprototyped (K&R style) C functions. */
if (printed_any && type->has_varargs ()) if (printed_any && type->has_varargs ())
{ {
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
stream->wrap_here (4); stream->wrap_here (4);
fprintf_filtered (stream, "..."); gdb_printf (stream, "...");
} }
} }
else if (!printed_any else if (!printed_any
&& (type->is_prototyped () || language == language_cplus)) && (type->is_prototyped () || language == language_cplus))
fprintf_filtered (stream, "void"); gdb_printf (stream, "void");
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
/* Return true iff the j'th overloading of the i'th method of TYPE /* Return true iff the j'th overloading of the i'th method of TYPE
@ -778,18 +778,18 @@ c_type_print_varspec_suffix (struct type *type,
int is_vector = type->is_vector (); int is_vector = type->is_vector ();
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
fprintf_filtered (stream, (is_vector ? gdb_printf (stream, (is_vector ?
" __attribute__ ((vector_size(" : "[")); " __attribute__ ((vector_size(" : "["));
/* Bounds are not yet resolved, print a bounds placeholder instead. */ /* Bounds are not yet resolved, print a bounds placeholder instead. */
if (type->bounds ()->high.kind () == PROP_LOCEXPR if (type->bounds ()->high.kind () == PROP_LOCEXPR
|| type->bounds ()->high.kind () == PROP_LOCLIST) || type->bounds ()->high.kind () == PROP_LOCLIST)
fprintf_filtered (stream, "variable length"); gdb_printf (stream, "variable length");
else if (get_array_bounds (type, &low_bound, &high_bound)) else if (get_array_bounds (type, &low_bound, &high_bound))
fprintf_filtered (stream, "%s", gdb_printf (stream, "%s",
plongest (high_bound - low_bound + 1)); plongest (high_bound - low_bound + 1));
fprintf_filtered (stream, (is_vector ? ")))" : "]")); gdb_printf (stream, (is_vector ? ")))" : "]"));
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
show, 0, 0, language, flags); show, 0, 0, language, flags);
@ -802,7 +802,7 @@ c_type_print_varspec_suffix (struct type *type,
break; break;
case TYPE_CODE_METHODPTR: case TYPE_CODE_METHODPTR:
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
show, 0, 0, language, flags); show, 0, 0, language, flags);
break; break;
@ -817,7 +817,7 @@ c_type_print_varspec_suffix (struct type *type,
case TYPE_CODE_METHOD: case TYPE_CODE_METHOD:
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
if (!demangled_args) if (!demangled_args)
c_type_print_args (type, stream, 0, language, flags); c_type_print_args (type, stream, 0, language, flags);
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
@ -889,14 +889,14 @@ c_type_print_template_args (const struct type_print_options *flags,
if (first) if (first)
{ {
stream->wrap_here (4); stream->wrap_here (4);
fprintf_filtered (stream, _("[with %s = "), sym->linkage_name ()); gdb_printf (stream, _("[with %s = "), sym->linkage_name ());
first = 0; first = 0;
} }
else else
{ {
gdb_puts (", ", stream); gdb_puts (", ", stream);
stream->wrap_here (9); stream->wrap_here (9);
fprintf_filtered (stream, "%s = ", sym->linkage_name ()); gdb_printf (stream, "%s = ", sym->linkage_name ());
} }
c_print_type (sym->type (), "", stream, -1, 0, flags); c_print_type (sym->type (), "", stream, -1, 0, flags);
@ -935,7 +935,7 @@ output_access_specifier (struct ui_file *stream,
{ {
last_access = s_protected; last_access = s_protected;
print_spaces_filtered_with_print_options (level + 2, stream, flags); print_spaces_filtered_with_print_options (level + 2, stream, flags);
fprintf_filtered (stream, "protected:\n"); gdb_printf (stream, "protected:\n");
} }
} }
else if (is_private) else if (is_private)
@ -944,7 +944,7 @@ output_access_specifier (struct ui_file *stream,
{ {
last_access = s_private; last_access = s_private;
print_spaces_filtered_with_print_options (level + 2, stream, flags); print_spaces_filtered_with_print_options (level + 2, stream, flags);
fprintf_filtered (stream, "private:\n"); gdb_printf (stream, "private:\n");
} }
} }
else else
@ -953,7 +953,7 @@ output_access_specifier (struct ui_file *stream,
{ {
last_access = s_public; last_access = s_public;
print_spaces_filtered_with_print_options (level + 2, stream, flags); print_spaces_filtered_with_print_options (level + 2, stream, flags);
fprintf_filtered (stream, "public:\n"); gdb_printf (stream, "public:\n");
} }
} }
@ -1061,11 +1061,11 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
c_type_print_modifier (type, stream, 0, 1, language); c_type_print_modifier (type, stream, 0, 1, language);
if (type->code () == TYPE_CODE_UNION) if (type->code () == TYPE_CODE_UNION)
fprintf_filtered (stream, "union "); gdb_printf (stream, "union ");
else if (type->is_declared_class ()) else if (type->is_declared_class ())
fprintf_filtered (stream, "class "); gdb_printf (stream, "class ");
else else
fprintf_filtered (stream, "struct "); gdb_printf (stream, "struct ");
/* Print the tag if it exists. The HP aCC compiler emits a /* Print the tag if it exists. The HP aCC compiler emits a
spurious "{unnamed struct}"/"{unnamed union}"/"{unnamed spurious "{unnamed struct}"/"{unnamed union}"/"{unnamed
@ -1087,7 +1087,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
/* If we just printed a tag name, no need to print anything /* If we just printed a tag name, no need to print anything
else. */ else. */
if (type->name () == NULL) if (type->name () == NULL)
fprintf_filtered (stream, "{...}"); gdb_printf (stream, "{...}");
} }
else if (show > 0 || type->name () == NULL) else if (show > 0 || type->name () == NULL)
{ {
@ -1117,18 +1117,18 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
local_flags.local_typedefs->recursively_update (type); local_flags.local_typedefs->recursively_update (type);
} }
fprintf_filtered (stream, "{\n"); gdb_printf (stream, "{\n");
if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0 if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0) && TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
{ {
print_spaces_filtered_with_print_options (level + 4, stream, flags); print_spaces_filtered_with_print_options (level + 4, stream, flags);
if (type->is_stub ()) if (type->is_stub ())
fprintf_filtered (stream, _("%p[<incomplete type>%p]\n"), gdb_printf (stream, _("%p[<incomplete type>%p]\n"),
metadata_style.style ().ptr (), nullptr); metadata_style.style ().ptr (), nullptr);
else else
fprintf_filtered (stream, _("%p[<no data fields>%p]\n"), gdb_printf (stream, _("%p[<no data fields>%p]\n"),
metadata_style.style ().ptr (), nullptr); metadata_style.style ().ptr (), nullptr);
} }
/* Start off with no specific section type, so we can print /* Start off with no specific section type, so we can print
@ -1177,7 +1177,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
print_spaces_filtered (level + 4, stream); print_spaces_filtered (level + 4, stream);
if (is_static) if (is_static)
fprintf_filtered (stream, "static "); gdb_printf (stream, "static ");
int newshow = show - 1; int newshow = show - 1;
@ -1218,10 +1218,10 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
unnamed fields. This would lead to misleading unnamed fields. This would lead to misleading
results if the compiler does not put out fields results if the compiler does not put out fields
for such things (I don't know what it does). */ for such things (I don't know what it does). */
fprintf_filtered (stream, " : %d", gdb_printf (stream, " : %d",
TYPE_FIELD_BITSIZE (type, i)); TYPE_FIELD_BITSIZE (type, i));
} }
fprintf_filtered (stream, ";\n"); gdb_printf (stream, ";\n");
} }
/* If there are both fields and methods, put a blank line /* If there are both fields and methods, put a blank line
@ -1242,7 +1242,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
real_len++; real_len++;
} }
if (real_len > 0 && section_type != s_none) if (real_len > 0 && section_type != s_none)
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
/* C++: print out the methods. */ /* C++: print out the methods. */
for (int i = 0; i < len; i++) for (int i = 0; i < len; i++)
@ -1278,16 +1278,16 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
print_spaces_filtered_with_print_options (level + 4, stream, print_spaces_filtered_with_print_options (level + 4, stream,
flags); flags);
if (TYPE_FN_FIELD_VIRTUAL_P (f, j)) if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
fprintf_filtered (stream, "virtual "); gdb_printf (stream, "virtual ");
else if (TYPE_FN_FIELD_STATIC_P (f, j)) else if (TYPE_FN_FIELD_STATIC_P (f, j))
fprintf_filtered (stream, "static "); gdb_printf (stream, "static ");
if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0) if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
{ {
/* Keep GDB from crashing here. */ /* Keep GDB from crashing here. */
fprintf_filtered (stream, gdb_printf (stream,
_("%p[<undefined type>%p] %s;\n"), _("%p[<undefined type>%p] %s;\n"),
metadata_style.style ().ptr (), nullptr, metadata_style.style ().ptr (), nullptr,
TYPE_FN_FIELD_PHYSNAME (f, j)); TYPE_FN_FIELD_PHYSNAME (f, j));
break; break;
} }
else if (!is_constructor /* Constructors don't else if (!is_constructor /* Constructors don't
@ -1358,7 +1358,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
gdb_puts (demangled_no_class, stream); gdb_puts (demangled_no_class, stream);
} }
fprintf_filtered (stream, ";\n"); gdb_printf (stream, ";\n");
} }
} }
@ -1370,7 +1370,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
--semi_local_flags.print_nested_type_limit; --semi_local_flags.print_nested_type_limit;
if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0) if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0)
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
for (int i = 0; i < TYPE_NESTED_TYPES_COUNT (type); ++i) for (int i = 0; i < TYPE_NESTED_TYPES_COUNT (type); ++i)
{ {
@ -1379,7 +1379,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
c_print_type_no_offsets (TYPE_NESTED_TYPES_FIELD_TYPE (type, i), c_print_type_no_offsets (TYPE_NESTED_TYPES_FIELD_TYPE (type, i),
"", stream, show, level + 4, "", stream, show, level + 4,
language, &semi_local_flags, podata); language, &semi_local_flags, podata);
fprintf_filtered (stream, ";\n"); gdb_printf (stream, ";\n");
} }
} }
@ -1389,7 +1389,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
{ {
if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0 if (type->num_fields () != 0 || TYPE_NFN_FIELDS (type) != 0
|| TYPE_NESTED_TYPES_COUNT (type) != 0) || TYPE_NESTED_TYPES_COUNT (type) != 0)
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
for (int i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++) for (int i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++)
{ {
@ -1408,7 +1408,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
} }
print_spaces_filtered_with_print_options (level + 4, stream, print_spaces_filtered_with_print_options (level + 4, stream,
flags); flags);
fprintf_filtered (stream, "typedef "); gdb_printf (stream, "typedef ");
/* We want to print typedefs with substitutions /* We want to print typedefs with substitutions
from the template parameters or globally-known from the template parameters or globally-known
@ -1417,7 +1417,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
TYPE_TYPEDEF_FIELD_NAME (type, i), TYPE_TYPEDEF_FIELD_NAME (type, i),
stream, show - 1, level + 4, stream, show - 1, level + 4,
language, &semi_local_flags, podata); language, &semi_local_flags, podata);
fprintf_filtered (stream, ";\n"); gdb_printf (stream, ";\n");
} }
} }
@ -1431,7 +1431,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
print_spaces_filtered (2, stream); print_spaces_filtered (2, stream);
} }
fprintf_filtered (stream, "%*s}", level, ""); gdb_printf (stream, "%*s}", level, "");
} }
} }
@ -1488,16 +1488,16 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
if (language == language_c || language == language_minimal) if (language == language_c || language == language_minimal)
{ {
if (type->code () == TYPE_CODE_UNION) if (type->code () == TYPE_CODE_UNION)
fprintf_filtered (stream, "union "); gdb_printf (stream, "union ");
else if (type->code () == TYPE_CODE_STRUCT) else if (type->code () == TYPE_CODE_STRUCT)
{ {
if (type->is_declared_class ()) if (type->is_declared_class ())
fprintf_filtered (stream, "class "); gdb_printf (stream, "class ");
else else
fprintf_filtered (stream, "struct "); gdb_printf (stream, "struct ");
} }
else if (type->code () == TYPE_CODE_ENUM) else if (type->code () == TYPE_CODE_ENUM)
fprintf_filtered (stream, "enum "); gdb_printf (stream, "enum ");
} }
print_name_maybe_canonical (type->name (), flags, stream); print_name_maybe_canonical (type->name (), flags, stream);
@ -1543,9 +1543,9 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
c_type_print_modifier (type, stream, 0, 1, language); c_type_print_modifier (type, stream, 0, 1, language);
fprintf_filtered (stream, "enum "); gdb_printf (stream, "enum ");
if (type->is_declared_class ()) if (type->is_declared_class ())
fprintf_filtered (stream, "class "); gdb_printf (stream, "class ");
/* Print the tag name if it exists. /* Print the tag name if it exists.
The aCC compiler emits a spurious The aCC compiler emits a spurious
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}" "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
@ -1565,7 +1565,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
/* If we just printed a tag name, no need to print anything /* If we just printed a tag name, no need to print anything
else. */ else. */
if (type->name () == NULL) if (type->name () == NULL)
fprintf_filtered (stream, "{...}"); gdb_printf (stream, "{...}");
} }
else if (show > 0 || type->name () == NULL) else if (show > 0 || type->name () == NULL)
{ {
@ -1584,28 +1584,28 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
struct type *underlying = check_typedef (TYPE_TARGET_TYPE (type)); struct type *underlying = check_typedef (TYPE_TARGET_TYPE (type));
if (underlying->name () != NULL) if (underlying->name () != NULL)
fprintf_filtered (stream, ": %s ", underlying->name ()); gdb_printf (stream, ": %s ", underlying->name ());
} }
fprintf_filtered (stream, "{"); gdb_printf (stream, "{");
len = type->num_fields (); len = type->num_fields ();
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
QUIT; QUIT;
if (i) if (i)
fprintf_filtered (stream, ", "); gdb_printf (stream, ", ");
stream->wrap_here (4); stream->wrap_here (4);
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
if (lastval != type->field (i).loc_enumval ()) if (lastval != type->field (i).loc_enumval ())
{ {
fprintf_filtered (stream, " = %s", gdb_printf (stream, " = %s",
plongest (type->field (i).loc_enumval ())); plongest (type->field (i).loc_enumval ()));
lastval = type->field (i).loc_enumval (); lastval = type->field (i).loc_enumval ();
} }
lastval++; lastval++;
} }
fprintf_filtered (stream, "}"); gdb_printf (stream, "}");
} }
break; break;
@ -1616,24 +1616,24 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
local_flags.local_typedefs = NULL; local_flags.local_typedefs = NULL;
c_type_print_modifier (type, stream, 0, 1, language); c_type_print_modifier (type, stream, 0, 1, language);
fprintf_filtered (stream, "flag "); gdb_printf (stream, "flag ");
print_name_maybe_canonical (type->name (), flags, stream); print_name_maybe_canonical (type->name (), flags, stream);
if (show > 0) if (show > 0)
{ {
gdb_puts (" ", stream); gdb_puts (" ", stream);
fprintf_filtered (stream, "{\n"); gdb_printf (stream, "{\n");
if (type->num_fields () == 0) if (type->num_fields () == 0)
{ {
if (type->is_stub ()) if (type->is_stub ())
fprintf_filtered (stream, gdb_printf (stream,
_("%*s%p[<incomplete type>%p]\n"), _("%*s%p[<incomplete type>%p]\n"),
level + 4, "", level + 4, "",
metadata_style.style ().ptr (), nullptr); metadata_style.style ().ptr (), nullptr);
else else
fprintf_filtered (stream, gdb_printf (stream,
_("%*s%p[<no data fields>%p]\n"), _("%*s%p[<no data fields>%p]\n"),
level + 4, "", level + 4, "",
metadata_style.style ().ptr (), nullptr); metadata_style.style ().ptr (), nullptr);
} }
len = type->num_fields (); len = type->num_fields ();
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
@ -1646,32 +1646,32 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
type->field (i).name (), type->field (i).name (),
stream, show, level + 4, stream, show, level + 4,
language, &local_flags, podata); language, &local_flags, podata);
fprintf_filtered (stream, " @%s", gdb_printf (stream, " @%s",
plongest (type->field (i).loc_bitpos ())); plongest (type->field (i).loc_bitpos ()));
if (TYPE_FIELD_BITSIZE (type, i) > 1) if (TYPE_FIELD_BITSIZE (type, i) > 1)
{ {
fprintf_filtered (stream, "-%s", gdb_printf (stream, "-%s",
plongest (type->field (i).loc_bitpos () plongest (type->field (i).loc_bitpos ()
+ TYPE_FIELD_BITSIZE (type, i) + TYPE_FIELD_BITSIZE (type, i)
- 1)); - 1));
} }
fprintf_filtered (stream, ";\n"); gdb_printf (stream, ";\n");
} }
fprintf_filtered (stream, "%*s}", level, ""); gdb_printf (stream, "%*s}", level, "");
} }
} }
break; break;
case TYPE_CODE_VOID: case TYPE_CODE_VOID:
fprintf_filtered (stream, "void"); gdb_printf (stream, "void");
break; break;
case TYPE_CODE_UNDEF: case TYPE_CODE_UNDEF:
fprintf_filtered (stream, _("struct <unknown>")); gdb_printf (stream, _("struct <unknown>"));
break; break;
case TYPE_CODE_ERROR: case TYPE_CODE_ERROR:
fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type)); gdb_printf (stream, "%s", TYPE_ERROR_NAME (type));
break; break;
case TYPE_CODE_RANGE: case TYPE_CODE_RANGE:

View file

@ -221,7 +221,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
current_language); current_language);
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
} }
@ -298,18 +298,18 @@ c_value_print_array (struct value *val,
else else
{ {
unsigned int i = 0; unsigned int i = 0;
fprintf_filtered (stream, "{"); gdb_printf (stream, "{");
/* If this is a virtual function table, print the 0th /* If this is a virtual function table, print the 0th
entry specially, and the rest of the members entry specially, and the rest of the members
normally. */ normally. */
if (cp_is_vtbl_ptr_type (elttype)) if (cp_is_vtbl_ptr_type (elttype))
{ {
i = 1; i = 1;
fprintf_filtered (stream, _("%d vtable entries"), gdb_printf (stream, _("%d vtable entries"),
len - 1); len - 1);
} }
value_print_array_elements (val, stream, recurse, options, i); value_print_array_elements (val, stream, recurse, options, i);
fprintf_filtered (stream, "}"); gdb_printf (stream, "}");
} }
} }
else else
@ -365,7 +365,7 @@ c_value_print_struct (struct value *val, struct ui_file *stream, int recurse,
struct type *type = check_typedef (value_type (val)); struct type *type = check_typedef (value_type (val));
if (type->code () == TYPE_CODE_UNION && recurse && !options->unionprint) if (type->code () == TYPE_CODE_UNION && recurse && !options->unionprint)
fprintf_filtered (stream, "{...}"); gdb_printf (stream, "{...}");
else if (options->vtblprint && cp_is_vtbl_ptr_type (type)) else if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{ {
/* Print the unmangled name if desired. */ /* Print the unmangled name if desired. */
@ -517,7 +517,7 @@ c_value_print (struct value *val, struct ui_file *stream,
} }
/* Pointer to class, check real type of object. */ /* Pointer to class, check real type of object. */
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
if (value_entirely_available (val)) if (value_entirely_available (val))
{ {
@ -542,19 +542,19 @@ c_value_print (struct value *val, struct ui_file *stream,
type = value_type (val); type = value_type (val);
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
} }
else else
{ {
/* normal case */ /* normal case */
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
type_print (value_type (val), "", stream, -1); type_print (value_type (val), "", stream, -1);
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
} }
} }
if (!value_initialized (val)) if (!value_initialized (val))
fprintf_filtered (stream, " [uninitialized] "); gdb_printf (stream, " [uninitialized] ");
if (options->objectprint && (type->code () == TYPE_CODE_STRUCT)) if (options->objectprint && (type->code () == TYPE_CODE_STRUCT))
{ {
@ -572,15 +572,15 @@ c_value_print (struct value *val, struct ui_file *stream,
&& (TYPE_LENGTH (real_type) && (TYPE_LENGTH (real_type)
< TYPE_LENGTH (value_enclosing_type (val))))) < TYPE_LENGTH (value_enclosing_type (val)))))
val = value_cast (real_type, val); val = value_cast (real_type, val);
fprintf_filtered (stream, "(%s%s) ", gdb_printf (stream, "(%s%s) ",
real_type->name (), real_type->name (),
full ? "" : _(" [incomplete object]")); full ? "" : _(" [incomplete object]"));
} }
else if (type != check_typedef (value_enclosing_type (val))) else if (type != check_typedef (value_enclosing_type (val)))
{ {
/* No RTTI information, so let's do our best. */ /* No RTTI information, so let's do our best. */
fprintf_filtered (stream, "(%s ?) ", gdb_printf (stream, "(%s ?) ",
value_enclosing_type (val)->name ()); value_enclosing_type (val)->name ());
val = value_cast (value_enclosing_type (val), val); val = value_cast (value_enclosing_type (val), val);
} }
} }

View file

@ -232,11 +232,11 @@ show_host_charset_name (struct ui_file *file, int from_tty,
const char *value) const char *value)
{ {
if (!strcmp (value, "auto")) if (!strcmp (value, "auto"))
fprintf_filtered (file, gdb_printf (file,
_("The host character set is \"auto; currently %s\".\n"), _("The host character set is \"auto; currently %s\".\n"),
auto_host_charset_name); auto_host_charset_name);
else else
fprintf_filtered (file, _("The host character set is \"%s\".\n"), value); gdb_printf (file, _("The host character set is \"%s\".\n"), value);
} }
static const char *target_charset_name = "auto"; static const char *target_charset_name = "auto";
@ -245,13 +245,13 @@ show_target_charset_name (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (!strcmp (value, "auto")) if (!strcmp (value, "auto"))
fprintf_filtered (file, gdb_printf (file,
_("The target character set is \"auto; " _("The target character set is \"auto; "
"currently %s\".\n"), "currently %s\".\n"),
gdbarch_auto_charset (get_current_arch ())); gdbarch_auto_charset (get_current_arch ()));
else else
fprintf_filtered (file, _("The target character set is \"%s\".\n"), gdb_printf (file, _("The target character set is \"%s\".\n"),
value); value);
} }
static const char *target_wide_charset_name = "auto"; static const char *target_wide_charset_name = "auto";
@ -262,13 +262,13 @@ show_target_wide_charset_name (struct ui_file *file,
const char *value) const char *value)
{ {
if (!strcmp (value, "auto")) if (!strcmp (value, "auto"))
fprintf_filtered (file, gdb_printf (file,
_("The target wide character set is \"auto; " _("The target wide character set is \"auto; "
"currently %s\".\n"), "currently %s\".\n"),
gdbarch_auto_wide_charset (get_current_arch ())); gdbarch_auto_wide_charset (get_current_arch ()));
else else
fprintf_filtered (file, _("The target wide character set is \"%s\".\n"), gdb_printf (file, _("The target wide character set is \"%s\".\n"),
value); value);
} }
static const char * const default_charset_names[] = static const char * const default_charset_names[] =

View file

@ -209,7 +209,7 @@ cli_ui_out::do_spaces (int numspaces)
return; return;
if (test_flags (unfiltered_output)) if (test_flags (unfiltered_output))
fprintf_unfiltered (m_streams.back (), "%*s", numspaces, ""); gdb_printf (m_streams.back (), "%*s", numspaces, "");
else else
print_spaces_filtered (numspaces, m_streams.back ()); print_spaces_filtered (numspaces, m_streams.back ());
} }
@ -295,7 +295,7 @@ cli_ui_out::do_progress_start (const std::string &name, bool should_print)
meter.name = name; meter.name = name;
if (!stream->isatty ()) if (!stream->isatty ())
{ {
fprintf_unfiltered (stream, "%s...", meter.name.c_str ()); gdb_printf (stream, "%s...", meter.name.c_str ());
gdb_flush (stream); gdb_flush (stream);
meter.printing = WORKING; meter.printing = WORKING;
} }
@ -322,7 +322,7 @@ cli_ui_out::do_progress_notify (double howmuch)
if (meter.printing == START) if (meter.printing == START)
{ {
fprintf_unfiltered (stream, "%s\n", meter.name.c_str ()); gdb_printf (stream, "%s\n", meter.name.c_str ());
gdb_flush (stream); gdb_flush (stream);
meter.printing = WORKING; meter.printing = WORKING;
} }
@ -340,10 +340,10 @@ cli_ui_out::do_progress_notify (double howmuch)
int width = chars_per_line - 3; int width = chars_per_line - 3;
max = width * howmuch; max = width * howmuch;
fprintf_unfiltered (stream, "\r["); gdb_printf (stream, "\r[");
for (i = 0; i < width; ++i) for (i = 0; i < width; ++i)
fprintf_unfiltered (stream, i < max ? "#" : " "); gdb_printf (stream, i < max ? "#" : " ");
fprintf_unfiltered (stream, "]"); gdb_printf (stream, "]");
gdb_flush (stream); gdb_flush (stream);
meter.printing = PROGRESS; meter.printing = PROGRESS;
} }
@ -357,7 +357,7 @@ cli_ui_out::do_progress_end ()
if (!stream->isatty ()) if (!stream->isatty ())
{ {
fprintf_unfiltered (stream, "\n"); gdb_printf (stream, "\n");
gdb_flush (stream); gdb_flush (stream);
} }
else if (meter.printing == PROGRESS) else if (meter.printing == PROGRESS)
@ -365,10 +365,10 @@ cli_ui_out::do_progress_end ()
int i; int i;
int width = get_chars_per_line () - 3; int width = get_chars_per_line () - 3;
fprintf_unfiltered (stream, "\r"); gdb_printf (stream, "\r");
for (i = 0; i < width + 2; ++i) for (i = 0; i < width + 2; ++i)
fprintf_unfiltered (stream, " "); gdb_printf (stream, " ");
fprintf_unfiltered (stream, "\r"); gdb_printf (stream, "\r");
gdb_flush (stream); gdb_flush (stream);
} }

View file

@ -460,7 +460,7 @@ static void
show_version (const char *args, int from_tty) show_version (const char *args, int from_tty)
{ {
print_gdb_version (gdb_stdout, true); print_gdb_version (gdb_stdout, true);
printf_filtered ("\n"); gdb_printf ("\n");
} }
static void static void
@ -506,14 +506,14 @@ pwd_command (const char *args, int from_tty)
safe_strerror (errno)); safe_strerror (errno));
if (strcmp (cwd.get (), current_directory) != 0) if (strcmp (cwd.get (), current_directory) != 0)
printf_filtered (_("Working directory %ps\n (canonically %ps).\n"), gdb_printf (_("Working directory %ps\n (canonically %ps).\n"),
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
current_directory), current_directory),
styled_string (file_name_style.style (), cwd.get ())); styled_string (file_name_style.style (), cwd.get ()));
else else
printf_filtered (_("Working directory %ps.\n"), gdb_printf (_("Working directory %ps.\n"),
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
current_directory)); current_directory));
} }
void void
@ -626,9 +626,9 @@ static void
show_script_ext_mode (struct ui_file *file, int from_tty, show_script_ext_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Script filename extension recognition is \"%s\".\n"), _("Script filename extension recognition is \"%s\".\n"),
value); value);
} }
/* Try to open SCRIPT_FILE. /* Try to open SCRIPT_FILE.
@ -837,10 +837,10 @@ echo_command (const char *text, int from_tty)
c = parse_escape (get_current_arch (), &p); c = parse_escape (get_current_arch (), &p);
if (c >= 0) if (c >= 0)
printf_filtered ("%c", c); gdb_printf ("%c", c);
} }
else else
printf_filtered ("%c", c); gdb_printf ("%c", c);
} }
gdb_stdout->reset_style (); gdb_stdout->reset_style ();
@ -894,10 +894,10 @@ shell_escape (const char *arg, int from_tty)
arg = "inferior shell"; arg = "inferior shell";
if (rc == -1) if (rc == -1)
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", arg, gdb_printf (gdb_stderr, "Cannot execute %s: %s\n", arg,
safe_strerror (errno)); safe_strerror (errno));
else if (rc) else if (rc)
fprintf_unfiltered (gdb_stderr, "%s exited with status %d\n", arg, rc); gdb_printf (gdb_stderr, "%s exited with status %d\n", arg, rc);
#ifdef GLOBAL_CURDIR #ifdef GLOBAL_CURDIR
/* Make sure to return to the directory GDB thinks it is, in case /* Make sure to return to the directory GDB thinks it is, in case
the shell command we just ran changed it. */ the shell command we just ran changed it. */
@ -921,8 +921,8 @@ shell_escape (const char *arg, int from_tty)
else else
execl (user_shell, p, "-c", arg, (char *) 0); execl (user_shell, p, "-c", arg, (char *) 0);
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell, gdb_printf (gdb_stderr, "Cannot execute %s: %s\n", user_shell,
safe_strerror (errno)); safe_strerror (errno));
_exit (0177); _exit (0177);
} }
@ -1011,16 +1011,16 @@ edit_command (const char *arg, int from_tty)
gdbarch = sal.symtab->objfile ()->arch (); gdbarch = sal.symtab->objfile ()->arch ();
sym = find_pc_function (sal.pc); sym = find_pc_function (sal.pc);
if (sym) if (sym)
printf_filtered ("%s is in %s (%s:%d).\n", gdb_printf ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
sym->print_name (), sym->print_name (),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line); sal.line);
else else
printf_filtered ("%s is at %s:%d.\n", gdb_printf ("%s is at %s:%d.\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line); sal.line);
} }
/* If what was given does not imply a symtab, it must be an /* If what was given does not imply a symtab, it must be an
@ -1350,14 +1350,14 @@ list_command (const char *arg, int from_tty)
gdbarch = sal.symtab->objfile ()->arch (); gdbarch = sal.symtab->objfile ()->arch ();
sym = find_pc_function (sal.pc); sym = find_pc_function (sal.pc);
if (sym) if (sym)
printf_filtered ("%s is in %s (%s:%d).\n", gdb_printf ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
sym->print_name (), sym->print_name (),
symtab_to_filename_for_display (sal.symtab), sal.line); symtab_to_filename_for_display (sal.symtab), sal.line);
else else
printf_filtered ("%s is at %s:%d.\n", gdb_printf ("%s is at %s:%d.\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
symtab_to_filename_for_display (sal.symtab), sal.line); symtab_to_filename_for_display (sal.symtab), sal.line);
} }
/* If line was not specified by just a line number, and it does not /* If line was not specified by just a line number, and it does not
@ -1425,18 +1425,18 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
else else
#endif #endif
{ {
printf_filtered (_("Dump of assembler code ")); gdb_printf (_("Dump of assembler code "));
if (name != NULL) if (name != NULL)
printf_filtered (_("for function %ps:\n"), gdb_printf (_("for function %ps:\n"),
styled_string (function_name_style.style (), name)); styled_string (function_name_style.style (), name));
if (block == nullptr || BLOCK_CONTIGUOUS_P (block)) if (block == nullptr || BLOCK_CONTIGUOUS_P (block))
{ {
if (name == NULL) if (name == NULL)
printf_filtered (_("from %ps to %ps:\n"), gdb_printf (_("from %ps to %ps:\n"),
styled_string (address_style.style (), styled_string (address_style.style (),
paddress (gdbarch, low)), paddress (gdbarch, low)),
styled_string (address_style.style (), styled_string (address_style.style (),
paddress (gdbarch, high))); paddress (gdbarch, high)));
/* Dump the specified range. */ /* Dump the specified range. */
gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high); gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high);
@ -1447,16 +1447,16 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
{ {
CORE_ADDR range_low = BLOCK_RANGE_START (block, i); CORE_ADDR range_low = BLOCK_RANGE_START (block, i);
CORE_ADDR range_high = BLOCK_RANGE_END (block, i); CORE_ADDR range_high = BLOCK_RANGE_END (block, i);
printf_filtered (_("Address range %ps to %ps:\n"), gdb_printf (_("Address range %ps to %ps:\n"),
styled_string (address_style.style (), styled_string (address_style.style (),
paddress (gdbarch, range_low)), paddress (gdbarch, range_low)),
styled_string (address_style.style (), styled_string (address_style.style (),
paddress (gdbarch, range_high))); paddress (gdbarch, range_high)));
gdb_disassembly (gdbarch, current_uiout, flags, -1, gdb_disassembly (gdbarch, current_uiout, flags, -1,
range_low, range_high); range_low, range_high);
} }
} }
printf_filtered (_("End of assembler dump.\n")); gdb_printf (_("End of assembler dump.\n"));
} }
} }
@ -2020,9 +2020,9 @@ print_sal_location (const symtab_and_line &sal)
const char *sym_name = NULL; const char *sym_name = NULL;
if (sal.symbol != NULL) if (sal.symbol != NULL)
sym_name = sal.symbol->print_name (); sym_name = sal.symbol->print_name ();
printf_filtered (_("file: \"%s\", line number: %d, symbol: \"%s\"\n"), gdb_printf (_("file: \"%s\", line number: %d, symbol: \"%s\"\n"),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line, sym_name != NULL ? sym_name : "???"); sal.line, sym_name != NULL ? sym_name : "???");
} }
/* Print a list of files and line numbers which a user may choose from /* Print a list of files and line numbers which a user may choose from
@ -2117,28 +2117,28 @@ show_info_verbose (struct ui_file *file, int from_tty,
const char *value) const char *value)
{ {
if (info_verbose) if (info_verbose)
fprintf_filtered (file, gdb_printf (file,
_("Verbose printing of informational messages is %s.\n"), _("Verbose printing of informational messages is %s.\n"),
value); value);
else else
fprintf_filtered (file, _("Verbosity is %s.\n"), value); gdb_printf (file, _("Verbosity is %s.\n"), value);
} }
static void static void
show_history_expansion_p (struct ui_file *file, int from_tty, show_history_expansion_p (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("History expansion on command input is %s.\n"), gdb_printf (file, _("History expansion on command input is %s.\n"),
value); value);
} }
static void static void
show_max_user_call_depth (struct ui_file *file, int from_tty, show_max_user_call_depth (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("The max call depth for user-defined commands is %s.\n"), _("The max call depth for user-defined commands is %s.\n"),
value); value);
} }
/* Implement 'show suppress-cli-notifications'. */ /* Implement 'show suppress-cli-notifications'. */
@ -2147,8 +2147,8 @@ static void
show_suppress_cli_notifications (ui_file *file, int from_tty, show_suppress_cli_notifications (ui_file *file, int from_tty,
cmd_list_element *c, const char *value) cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Suppression of printing CLI notifications " gdb_printf (file, _("Suppression of printing CLI notifications "
"is %s.\n"), value); "is %s.\n"), value);
} }
/* Implement 'set suppress-cli-notifications'. */ /* Implement 'set suppress-cli-notifications'. */

View file

@ -1357,9 +1357,9 @@ fput_alias_definition_styled (const cmd_list_element &c,
gdb_assert (c.is_alias ()); gdb_assert (c.is_alias ());
gdb_puts (" alias ", stream); gdb_puts (" alias ", stream);
fput_command_name_styled (c, stream); fput_command_name_styled (c, stream);
fprintf_filtered (stream, " = "); gdb_printf (stream, " = ");
fput_command_name_styled (*c.alias_target, stream); fput_command_name_styled (*c.alias_target, stream);
fprintf_filtered (stream, " %s\n", c.default_args.c_str ()); gdb_printf (stream, " %s\n", c.default_args.c_str ());
} }
/* Print the definition of the aliases of CMD that have default args. */ /* Print the definition of the aliases of CMD that have default args. */
@ -1579,7 +1579,7 @@ help_cmd (const char *command, struct ui_file *stream)
if (!c->is_prefix () && !c->is_command_class_help ()) if (!c->is_prefix () && !c->is_command_class_help ())
return; return;
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
/* If this is a prefix command, print it's subcommands. */ /* If this is a prefix command, print it's subcommands. */
if (c->is_prefix ()) if (c->is_prefix ())
@ -1591,17 +1591,17 @@ help_cmd (const char *command, struct ui_file *stream)
help_list (cmdlist, "", c->theclass, stream); help_list (cmdlist, "", c->theclass, stream);
if (c->hook_pre || c->hook_post) if (c->hook_pre || c->hook_post)
fprintf_filtered (stream, gdb_printf (stream,
"\nThis command has a hook (or hooks) defined:\n"); "\nThis command has a hook (or hooks) defined:\n");
if (c->hook_pre) if (c->hook_pre)
fprintf_filtered (stream, gdb_printf (stream,
"\tThis command is run after : %s (pre hook)\n", "\tThis command is run after : %s (pre hook)\n",
c->hook_pre->name); c->hook_pre->name);
if (c->hook_post) if (c->hook_post)
fprintf_filtered (stream, gdb_printf (stream,
"\tThis command is run before : %s (post hook)\n", "\tThis command is run before : %s (post hook)\n",
c->hook_post->name); c->hook_post->name);
} }
/* /*
@ -1640,26 +1640,26 @@ help_list (struct cmd_list_element *list, const char *cmdtype,
} }
if (theclass == all_classes) if (theclass == all_classes)
fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2); gdb_printf (stream, "List of classes of %scommands:\n\n", cmdtype2);
else else
fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2); gdb_printf (stream, "List of %scommands:\n\n", cmdtype2);
help_cmd_list (list, theclass, theclass >= 0, stream); help_cmd_list (list, theclass, theclass >= 0, stream);
if (theclass == all_classes) if (theclass == all_classes)
{ {
fprintf_filtered (stream, "\n\ gdb_printf (stream, "\n\
Type \"help%s\" followed by a class name for a list of commands in ", Type \"help%s\" followed by a class name for a list of commands in ",
cmdtype1); cmdtype1);
stream->wrap_here (0); stream->wrap_here (0);
fprintf_filtered (stream, "that class."); gdb_printf (stream, "that class.");
fprintf_filtered (stream, "\n\ gdb_printf (stream, "\n\
Type \"help all\" for the list of all commands."); Type \"help all\" for the list of all commands.");
} }
fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ", gdb_printf (stream, "\nType \"help%s\" followed by %scommand name ",
cmdtype1, cmdtype2); cmdtype1, cmdtype2);
stream->wrap_here (0); stream->wrap_here (0);
gdb_puts ("for ", stream); gdb_puts ("for ", stream);
stream->wrap_here (0); stream->wrap_here (0);
@ -1690,7 +1690,7 @@ help_all (struct ui_file *stream)
if (c->is_command_class_help ()) if (c->is_command_class_help ())
{ {
fprintf_filtered (stream, "\nCommand class: %s\n\n", c->name); gdb_printf (stream, "\nCommand class: %s\n\n", c->name);
help_cmd_list (cmdlist, c->theclass, true, stream); help_cmd_list (cmdlist, c->theclass, true, stream);
} }
} }
@ -1708,7 +1708,7 @@ help_all (struct ui_file *stream)
{ {
if (!seen_unclassified) if (!seen_unclassified)
{ {
fprintf_filtered (stream, "\nUnclassified commands\n\n"); gdb_printf (stream, "\nUnclassified commands\n\n");
seen_unclassified = 1; seen_unclassified = 1;
} }
print_help_for_command (*c, true, stream); print_help_for_command (*c, true, stream);
@ -2281,23 +2281,23 @@ deprecated_cmd_warning (const char *text, struct cmd_list_element *list)
tmp_alias_str += std::string (alias->name); tmp_alias_str += std::string (alias->name);
if (cmd->cmd_deprecated) if (cmd->cmd_deprecated)
printf_filtered (_("Warning: command '%ps' (%ps) is deprecated.\n"), gdb_printf (_("Warning: command '%ps' (%ps) is deprecated.\n"),
styled_string (title_style.style (), styled_string (title_style.style (),
tmp_cmd_str.c_str ()), tmp_cmd_str.c_str ()),
styled_string (title_style.style (), styled_string (title_style.style (),
tmp_alias_str.c_str ())); tmp_alias_str.c_str ()));
else else
printf_filtered (_("Warning: '%ps', an alias for the command '%ps', " gdb_printf (_("Warning: '%ps', an alias for the command '%ps', "
"is deprecated.\n"), "is deprecated.\n"),
styled_string (title_style.style (), styled_string (title_style.style (),
tmp_alias_str.c_str ()), tmp_alias_str.c_str ()),
styled_string (title_style.style (), styled_string (title_style.style (),
tmp_cmd_str.c_str ())); tmp_cmd_str.c_str ()));
} }
else else
printf_filtered (_("Warning: command '%ps' is deprecated.\n"), gdb_printf (_("Warning: command '%ps' is deprecated.\n"),
styled_string (title_style.style (), styled_string (title_style.style (),
tmp_cmd_str.c_str ())); tmp_cmd_str.c_str ()));
/* Now display a second line indicating what the user should use instead. /* Now display a second line indicating what the user should use instead.
If it is only the alias that is deprecated, we want to indicate the If it is only the alias that is deprecated, we want to indicate the
@ -2308,11 +2308,11 @@ deprecated_cmd_warning (const char *text, struct cmd_list_element *list)
else else
replacement = cmd->replacement; replacement = cmd->replacement;
if (replacement != nullptr) if (replacement != nullptr)
printf_filtered (_("Use '%ps'.\n\n"), gdb_printf (_("Use '%ps'.\n\n"),
styled_string (title_style.style (), styled_string (title_style.style (),
replacement)); replacement));
else else
printf_filtered (_("No alternative known.\n\n")); gdb_printf (_("No alternative known.\n\n"));
/* We've warned you, now we'll keep quiet. */ /* We've warned you, now we'll keep quiet. */
if (alias != nullptr) if (alias != nullptr)

View file

@ -398,8 +398,8 @@ restore_one_section (bfd *ibfd, asection *isec,
|| (load_end > 0 && sec_start >= load_end)) || (load_end > 0 && sec_start >= load_end))
{ {
/* No, no useable data in this section. */ /* No, no useable data in this section. */
printf_filtered (_("skipping section %s...\n"), gdb_printf (_("skipping section %s...\n"),
bfd_section_name (isec)); bfd_section_name (isec));
return; return;
} }
@ -419,19 +419,19 @@ restore_one_section (bfd *ibfd, asection *isec,
error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd), error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd),
bfd_errmsg (bfd_get_error ())); bfd_errmsg (bfd_get_error ()));
printf_filtered ("Restoring section %s (0x%lx to 0x%lx)", gdb_printf ("Restoring section %s (0x%lx to 0x%lx)",
bfd_section_name (isec), bfd_section_name (isec),
(unsigned long) sec_start, (unsigned long) sec_start,
(unsigned long) sec_end); (unsigned long) sec_end);
if (load_offset != 0 || load_start != 0 || load_end != 0) if (load_offset != 0 || load_start != 0 || load_end != 0)
printf_filtered (" into memory (%s to %s)\n", gdb_printf (" into memory (%s to %s)\n",
paddress (target_gdbarch (), paddress (target_gdbarch (),
(unsigned long) sec_start (unsigned long) sec_start
+ sec_offset + load_offset), + sec_offset + load_offset),
paddress (target_gdbarch (), paddress (target_gdbarch (),
(unsigned long) sec_start + sec_offset (unsigned long) sec_start + sec_offset
+ load_offset + sec_load_count)); + load_offset + sec_load_count));
else else
gdb_puts ("\n"); gdb_puts ("\n");
@ -474,7 +474,7 @@ restore_binary_file (const char *filename, CORE_ADDR load_offset,
if (load_start > 0) if (load_start > 0)
len -= load_start; len -= load_start;
printf_filtered gdb_printf
("Restoring binary file %s into memory (0x%lx to 0x%lx)\n", ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n",
filename, filename,
(unsigned long) (load_start + load_offset), (unsigned long) (load_start + load_offset),
@ -542,10 +542,10 @@ restore_command (const char *args, int from_tty)
} }
if (info_verbose) if (info_verbose)
printf_filtered ("Restore file %s offset 0x%lx start 0x%lx end 0x%lx\n", gdb_printf ("Restore file %s offset 0x%lx start 0x%lx end 0x%lx\n",
filename.get (), (unsigned long) load_offset, filename.get (), (unsigned long) load_offset,
(unsigned long) load_start, (unsigned long) load_start,
(unsigned long) load_end); (unsigned long) load_end);
if (binary_flag) if (binary_flag)
{ {

View file

@ -31,8 +31,8 @@ static void
show_logging_filename (struct ui_file *file, int from_tty, show_logging_filename (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("The current logfile is \"%ps\".\n"), gdb_printf (file, _("The current logfile is \"%ps\".\n"),
styled_string (file_name_style.style (), value)); styled_string (file_name_style.style (), value));
} }
static bool logging_overwrite; static bool logging_overwrite;
@ -57,9 +57,9 @@ show_logging_overwrite (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (logging_overwrite) if (logging_overwrite)
fprintf_filtered (file, _("on: Logging overwrites the log file.\n")); gdb_printf (file, _("on: Logging overwrites the log file.\n"));
else else
fprintf_filtered (file, _("off: Logging appends to the log file.\n")); gdb_printf (file, _("off: Logging appends to the log file.\n"));
} }
/* Value as configured by the user. */ /* Value as configured by the user. */
@ -78,9 +78,9 @@ show_logging_redirect (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (logging_redirect) if (logging_redirect)
fprintf_filtered(file, _("on: Output will go only to the log file.\n")); gdb_printf (file, _("on: Output will go only to the log file.\n"));
else else
fprintf_filtered gdb_printf
(file, (file,
_("off: Output will go to both the screen and the log file.\n")); _("off: Output will go to both the screen and the log file.\n"));
} }
@ -90,10 +90,9 @@ show_logging_debug_redirect (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (debug_redirect) if (debug_redirect)
fprintf_filtered(file, gdb_printf (file, _("on: Debug output will go only to the log file.\n"));
_("on: Debug output will go only to the log file.\n"));
else else
fprintf_filtered gdb_printf
(file, (file,
_("off: Debug output will go to both the screen and the log file.\n")); _("off: Debug output will go to both the screen and the log file.\n"));
} }
@ -115,8 +114,8 @@ handle_redirections (int from_tty)
{ {
if (!saved_filename.empty ()) if (!saved_filename.empty ())
{ {
printf_filtered ("Already logging to %s.\n", gdb_printf ("Already logging to %s.\n",
saved_filename.c_str ()); saved_filename.c_str ());
return; return;
} }
@ -128,18 +127,18 @@ handle_redirections (int from_tty)
if (from_tty) if (from_tty)
{ {
if (!logging_redirect) if (!logging_redirect)
printf_filtered ("Copying output to %s.\n", gdb_printf ("Copying output to %s.\n",
logging_filename.c_str ()); logging_filename.c_str ());
else else
printf_filtered ("Redirecting output to %s.\n", gdb_printf ("Redirecting output to %s.\n",
logging_filename.c_str ()); logging_filename.c_str ());
if (!debug_redirect) if (!debug_redirect)
printf_filtered ("Copying debug output to %s.\n", gdb_printf ("Copying debug output to %s.\n",
logging_filename.c_str ()); logging_filename.c_str ());
else else
printf_filtered ("Redirecting debug output to %s.\n", gdb_printf ("Redirecting debug output to %s.\n",
logging_filename.c_str ()); logging_filename.c_str ());
} }
saved_filename = logging_filename; saved_filename = logging_filename;
@ -177,8 +176,8 @@ set_logging_off (const char *args, int from_tty)
pop_output_files (); pop_output_files ();
if (from_tty) if (from_tty)
printf_filtered ("Done logging to %s.\n", gdb_printf ("Done logging to %s.\n",
saved_filename.c_str ()); saved_filename.c_str ());
saved_filename.clear (); saved_filename.clear ();
} }
@ -199,9 +198,9 @@ show_logging_enabled (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (logging_enabled) if (logging_enabled)
fprintf_unfiltered (file, _("on: Logging is enabled.\n")); gdb_printf (file, _("on: Logging is enabled.\n"));
else else
fprintf_unfiltered (file, _("off: Logging is disabled.\n")); gdb_printf (file, _("off: Logging is disabled.\n"));
} }
void _initialize_cli_logging (); void _initialize_cli_logging ();

View file

@ -496,7 +496,7 @@ print_command_trace (const char *fmt, ...)
return; return;
for (i=0; i < command_nest_depth; i++) for (i=0; i < command_nest_depth; i++)
printf_filtered ("+"); gdb_printf ("+");
va_list args; va_list args;
@ -1647,11 +1647,11 @@ show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
{ {
struct command_line *cmdlines = c->user_commands.get (); struct command_line *cmdlines = c->user_commands.get ();
fprintf_filtered (stream, "User %scommand \"", gdb_printf (stream, "User %scommand \"",
c->is_prefix () ? "prefix" : ""); c->is_prefix () ? "prefix" : "");
fprintf_styled (stream, title_style.style (), "%s%s", fprintf_styled (stream, title_style.style (), "%s%s",
prefix, name); prefix, name);
fprintf_filtered (stream, "\":\n"); gdb_printf (stream, "\":\n");
if (cmdlines) if (cmdlines)
{ {
print_command_lines (current_uiout, cmdlines, 1); print_command_lines (current_uiout, cmdlines, 1);

View file

@ -140,11 +140,11 @@ deprecated_show_value_hack (struct ui_file *ignore_file,
case var_optional_filename: case var_optional_filename:
case var_filename: case var_filename:
case var_enum: case var_enum:
printf_filtered ((" is \"%s\".\n"), value); gdb_printf ((" is \"%s\".\n"), value);
break; break;
default: default:
printf_filtered ((" is %s.\n"), value); gdb_printf ((" is %s.\n"), value);
break; break;
} }
} }

View file

@ -189,7 +189,7 @@ do_show (const char *what, struct ui_file *file,
cli_style_option *cso = (cli_style_option *) cmd->context (); cli_style_option *cso = (cli_style_option *) cmd->context ();
gdb_puts (_("The "), file); gdb_puts (_("The "), file);
fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ()); fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ());
fprintf_filtered (file, _(" %s is: %s\n"), what, value); gdb_printf (file, _(" %s is: %s\n"), what, value);
} }
/* See cli-style.h. */ /* See cli-style.h. */
@ -299,9 +299,9 @@ show_style_enabled (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (cli_styling) if (cli_styling)
fprintf_filtered (file, _("CLI output styling is enabled.\n")); gdb_printf (file, _("CLI output styling is enabled.\n"));
else else
fprintf_filtered (file, _("CLI output styling is disabled.\n")); gdb_printf (file, _("CLI output styling is disabled.\n"));
} }
static void static void
@ -309,9 +309,9 @@ show_style_sources (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (source_styling) if (source_styling)
fprintf_filtered (file, _("Source code styling is enabled.\n")); gdb_printf (file, _("Source code styling is enabled.\n"));
else else
fprintf_filtered (file, _("Source code styling is disabled.\n")); gdb_printf (file, _("Source code styling is disabled.\n"));
} }
/* Implement 'show style disassembler'. */ /* Implement 'show style disassembler'. */
@ -321,9 +321,9 @@ show_style_disassembler (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
if (disassembler_styling) if (disassembler_styling)
fprintf_filtered (file, _("Disassembler output styling is enabled.\n")); gdb_printf (file, _("Disassembler output styling is enabled.\n"));
else else
fprintf_filtered (file, _("Disassembler output styling is disabled.\n")); gdb_printf (file, _("Disassembler output styling is disabled.\n"));
} }
void _initialize_cli_style (); void _initialize_cli_style ();

View file

@ -100,7 +100,7 @@ get_number_trailer (const char **pp, int trailer)
retval = value_as_long (val); retval = value_as_long (val);
else else
{ {
printf_filtered (_("History value must have integer type.\n")); gdb_printf (_("History value must have integer type.\n"));
retval = 0; retval = 0;
} }
} }
@ -122,8 +122,8 @@ get_number_trailer (const char **pp, int trailer)
retval = (int) longest_val; retval = (int) longest_val;
else else
{ {
printf_filtered (_("Convenience variable must " gdb_printf (_("Convenience variable must "
"have integer value.\n")); "have integer value.\n"));
retval = 0; retval = 0;
} }
} }

View file

@ -174,10 +174,10 @@ add_pe_exported_sym (minimal_symbol_reader &reader,
= string_printf ("%s!%s", dll_name, bare_name.c_str ()); = string_printf ("%s!%s", dll_name, bare_name.c_str ());
if ((section_data->ms_type == mst_unknown) && debug_coff_pe_read) if ((section_data->ms_type == mst_unknown) && debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog , _("Unknown section type for \"%s\"" gdb_printf (gdb_stdlog , _("Unknown section type for \"%s\""
" for entry \"%s\" in dll \"%s\"\n"), " for entry \"%s\" in dll \"%s\"\n"),
section_data->section_name.c_str (), sym_name, section_data->section_name.c_str (), sym_name,
dll_name); dll_name);
reader.record_with_info (qualified_name.c_str (), vma, section_data->ms_type, reader.record_with_info (qualified_name.c_str (), vma, section_data->ms_type,
section_data->index); section_data->index);
@ -186,8 +186,8 @@ add_pe_exported_sym (minimal_symbol_reader &reader,
reader.record_with_info (bare_name.c_str (), vma, section_data->ms_type, reader.record_with_info (bare_name.c_str (), vma, section_data->ms_type,
section_data->index); section_data->index);
if (debug_coff_pe_read > 1) if (debug_coff_pe_read > 1)
fprintf_unfiltered (gdb_stdlog, _("Adding exported symbol \"%s\"" gdb_printf (gdb_stdlog, _("Adding exported symbol \"%s\""
" in dll \"%s\"\n"), sym_name, dll_name); " in dll \"%s\"\n"), sym_name, dll_name);
} }
/* Create a minimal symbol entry for an exported forward symbol. /* Create a minimal symbol entry for an exported forward symbol.
@ -232,17 +232,17 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
if (!msymbol.minsym) if (!msymbol.minsym)
{ {
if (debug_coff_pe_read) if (debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("Unable to find function \"%s\" in" gdb_printf (gdb_stdlog, _("Unable to find function \"%s\" in"
" dll \"%s\", forward of \"%s\" in dll \"%s\"\n"), " dll \"%s\", forward of \"%s\" in dll \"%s\"\n"),
forward_func_name, forward_dll_name, sym_name, forward_func_name, forward_dll_name, sym_name,
dll_name); dll_name);
return 0; return 0;
} }
if (debug_coff_pe_read > 1) if (debug_coff_pe_read > 1)
fprintf_unfiltered (gdb_stdlog, _("Adding forwarded exported symbol" gdb_printf (gdb_stdlog, _("Adding forwarded exported symbol"
" \"%s\" in dll \"%s\", pointing to \"%s\"\n"), " \"%s\" in dll \"%s\", pointing to \"%s\"\n"),
sym_name, dll_name, forward_qualified_name); sym_name, dll_name, forward_qualified_name);
vma = BMSYMBOL_VALUE_ADDRESS (msymbol); vma = BMSYMBOL_VALUE_ADDRESS (msymbol);
msymtype = MSYMBOL_TYPE (msymbol.minsym); msymtype = MSYMBOL_TYPE (msymbol.minsym);
@ -428,14 +428,14 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
if (strcmp (sname, ".edata") != 0) if (strcmp (sname, ".edata") != 0)
{ {
if (debug_coff_pe_read) if (debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("Export RVA for dll " gdb_printf (gdb_stdlog, _("Export RVA for dll "
"\"%s\" is in section \"%s\"\n"), "\"%s\" is in section \"%s\"\n"),
dll_name, sname); dll_name, sname);
} }
else if (export_opthdrrva != vaddr && debug_coff_pe_read) else if (export_opthdrrva != vaddr && debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("Wrong value of export RVA" gdb_printf (gdb_stdlog, _("Wrong value of export RVA"
" for dll \"%s\": 0x%lx instead of 0x%lx\n"), " for dll \"%s\": 0x%lx instead of 0x%lx\n"),
dll_name, export_opthdrrva, vaddr); dll_name, export_opthdrrva, vaddr);
expptr = fptr + (export_opthdrrva - vaddr); expptr = fptr + (export_opthdrrva - vaddr);
break; break;
} }
@ -532,8 +532,8 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
read_pe_truncate_name (dll_name); read_pe_truncate_name (dll_name);
if (debug_coff_pe_read) if (debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("DLL \"%s\" has %ld export entries," gdb_printf (gdb_stdlog, _("DLL \"%s\" has %ld export entries,"
" base=%ld\n"), dll_name, nexp, ordbase); " base=%ld\n"), dll_name, nexp, ordbase);
nbforward = 0; nbforward = 0;
nbnormal = 0; nbnormal = 0;
/* Iterate through the list of symbols. */ /* Iterate through the list of symbols. */
@ -605,16 +605,16 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
++nbnormal; ++nbnormal;
} }
else if (debug_coff_pe_read) else if (debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("Export name \"%s\" ord. %lu," gdb_printf (gdb_stdlog, _("Export name \"%s\" ord. %lu,"
" RVA 0x%lx in dll \"%s\" not handled\n"), " RVA 0x%lx in dll \"%s\" not handled\n"),
funcname, ordinal, func_rva, dll_name); funcname, ordinal, func_rva, dll_name);
} }
} }
if (debug_coff_pe_read) if (debug_coff_pe_read)
fprintf_unfiltered (gdb_stdlog, _("Finished reading \"%s\", exports %ld," gdb_printf (gdb_stdlog, _("Finished reading \"%s\", exports %ld,"
" forwards %ld, total %ld/%ld.\n"), dll_name, nbnormal, " forwards %ld, total %ld/%ld.\n"), dll_name, nbnormal,
nbforward, nbnormal + nbforward, nexp); nbforward, nbnormal + nbforward, nexp);
} }
/* Extract from ABFD the offset of the .text section. /* Extract from ABFD the offset of the .text section.
@ -686,7 +686,7 @@ static void
show_debug_coff_pe_read (struct ui_file *file, int from_tty, show_debug_coff_pe_read (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Coff PE read debugging is %s.\n"), value); gdb_printf (file, _("Coff PE read debugging is %s.\n"), value);
} }
/* Adds "Set/show debug coff_pe_read" commands. */ /* Adds "Set/show debug coff_pe_read" commands. */

View file

@ -161,7 +161,7 @@ print_one_macro (const char *name, const struct macro_definition *macro,
/* None of -Wno-builtin-macro-redefined, #undef first /* None of -Wno-builtin-macro-redefined, #undef first
or plain #define of the same value would avoid a warning. */ or plain #define of the same value would avoid a warning. */
fprintf_filtered (file, "#ifndef %s\n# define %s", name, name); gdb_printf (file, "#ifndef %s\n# define %s", name, name);
if (macro->kind == macro_function_like) if (macro->kind == macro_function_like)
{ {
@ -177,7 +177,7 @@ print_one_macro (const char *name, const struct macro_definition *macro,
gdb_puts (")", file); gdb_puts (")", file);
} }
fprintf_filtered (file, " %s\n#endif\n", macro->replacement); gdb_printf (file, " %s\n#endif\n", macro->replacement);
} }
/* Write macro definitions at PC to FILE. */ /* Write macro definitions at PC to FILE. */
@ -245,8 +245,8 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
switch (regtype->code ()) switch (regtype->code ())
{ {
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
fprintf_filtered (stream, "__gdb_uintptr %s", gdb_printf (stream, "__gdb_uintptr %s",
regname.c_str ()); regname.c_str ());
break; break;
case TYPE_CODE_INT: case TYPE_CODE_INT:
@ -258,11 +258,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
{ {
if (regtype->is_unsigned ()) if (regtype->is_unsigned ())
gdb_puts ("unsigned ", stream); gdb_puts ("unsigned ", stream);
fprintf_unfiltered (stream, gdb_printf (stream,
"int %s" "int %s"
" __attribute__ ((__mode__(__%s__)))", " __attribute__ ((__mode__(__%s__)))",
regname.c_str (), regname.c_str (),
mode); mode);
break; break;
} }
} }
@ -270,12 +270,12 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
/* Fall through. */ /* Fall through. */
default: default:
fprintf_unfiltered (stream, gdb_printf (stream,
" unsigned char %s[%s]" " unsigned char %s[%s]"
" __attribute__((__aligned__(" " __attribute__((__aligned__("
"__BIGGEST_ALIGNMENT__)))", "__BIGGEST_ALIGNMENT__)))",
regname.c_str (), regname.c_str (),
pulongest (TYPE_LENGTH (regtype))); pulongest (TYPE_LENGTH (regtype)));
} }
gdb_puts (";\n", stream); gdb_puts (";\n", stream);
} }
@ -393,15 +393,15 @@ struct c_add_input
{ {
case COMPILE_I_PRINT_ADDRESS_SCOPE: case COMPILE_I_PRINT_ADDRESS_SCOPE:
case COMPILE_I_PRINT_VALUE_SCOPE: case COMPILE_I_PRINT_VALUE_SCOPE:
fprintf_unfiltered (buf, gdb_printf (buf,
"__auto_type " COMPILE_I_EXPR_VAL " = %s;\n" "__auto_type " COMPILE_I_EXPR_VAL " = %s;\n"
"typeof (%s) *" COMPILE_I_EXPR_PTR_TYPE ";\n" "typeof (%s) *" COMPILE_I_EXPR_PTR_TYPE ";\n"
"memcpy (" COMPILE_I_PRINT_OUT_ARG ", %s" "memcpy (" COMPILE_I_PRINT_OUT_ARG ", %s"
COMPILE_I_EXPR_VAL ",\n" COMPILE_I_EXPR_VAL ",\n"
"sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n" "sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n"
, input, input, , input, input,
(type == COMPILE_I_PRINT_ADDRESS_SCOPE (type == COMPILE_I_PRINT_ADDRESS_SCOPE
? "&" : "")); ? "&" : ""));
break; break;
default: default:
@ -494,7 +494,7 @@ struct cplus_add_input
{ {
case COMPILE_I_PRINT_VALUE_SCOPE: case COMPILE_I_PRINT_VALUE_SCOPE:
case COMPILE_I_PRINT_ADDRESS_SCOPE: case COMPILE_I_PRINT_ADDRESS_SCOPE:
fprintf_unfiltered gdb_printf
(buf, (buf,
/* "auto" strips ref- and cv- qualifiers, so we need to also strip /* "auto" strips ref- and cv- qualifiers, so we need to also strip
those from COMPILE_I_EXPR_PTR_TYPE. */ those from COMPILE_I_EXPR_PTR_TYPE. */

View file

@ -241,17 +241,17 @@ convert_symbol_sym (compile_c_instance *context, const char *identifier,
&& global_sym.block != block_static_block (global_sym.block)) && global_sym.block != block_static_block (global_sym.block))
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": global symbol\n", "gcc_convert_symbol \"%s\": global symbol\n",
identifier); identifier);
convert_one_symbol (context, global_sym, 1, 0); convert_one_symbol (context, global_sym, 1, 0);
} }
} }
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": local symbol\n", "gcc_convert_symbol \"%s\": local symbol\n",
identifier); identifier);
convert_one_symbol (context, sym, 0, is_local_symbol); convert_one_symbol (context, sym, 0, is_local_symbol);
} }
@ -373,9 +373,9 @@ gcc_convert_symbol (void *datum,
} }
if (compile_debug && !found) if (compile_debug && !found)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": lookup_symbol failed\n", "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
identifier); identifier);
return; return;
} }
@ -401,9 +401,9 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
if (sym != NULL && sym->aclass () == LOC_BLOCK) if (sym != NULL && sym->aclass () == LOC_BLOCK)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": full symbol\n", "gcc_symbol_address \"%s\": full symbol\n",
identifier); identifier);
result = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)); result = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
if (sym->type ()->is_gnu_ifunc ()) if (sym->type ()->is_gnu_ifunc ())
result = gnu_ifunc_resolve_addr (target_gdbarch (), result); result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
@ -417,10 +417,10 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
if (msym.minsym != NULL) if (msym.minsym != NULL)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": minimal " "gcc_symbol_address \"%s\": minimal "
"symbol\n", "symbol\n",
identifier); identifier);
result = BMSYMBOL_VALUE_ADDRESS (msym); result = BMSYMBOL_VALUE_ADDRESS (msym);
if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc) if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
result = gnu_ifunc_resolve_addr (target_gdbarch (), result); result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
@ -435,9 +435,9 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
} }
if (compile_debug && !found) if (compile_debug && !found)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": failed\n", "gcc_symbol_address \"%s\": failed\n",
identifier); identifier);
return result; return result;
} }

View file

@ -253,17 +253,17 @@ convert_symbol_sym (compile_cplus_instance *instance,
&& global_sym.block != block_static_block (global_sym.block)) && global_sym.block != block_static_block (global_sym.block))
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": global symbol\n", "gcc_convert_symbol \"%s\": global symbol\n",
identifier); identifier);
convert_one_symbol (instance, global_sym, true, false); convert_one_symbol (instance, global_sym, true, false);
} }
} }
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": local symbol\n", "gcc_convert_symbol \"%s\": local symbol\n",
identifier); identifier);
convert_one_symbol (instance, sym, false, is_local_symbol); convert_one_symbol (instance, sym, false, is_local_symbol);
} }
@ -337,8 +337,8 @@ gcc_cplus_convert_symbol (void *datum,
const char *identifier) const char *identifier)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"got oracle request for \"%s\"\n", identifier); "got oracle request for \"%s\"\n", identifier);
bool found = false; bool found = false;
compile_cplus_instance *instance = (compile_cplus_instance *) datum; compile_cplus_instance *instance = (compile_cplus_instance *) datum;
@ -396,18 +396,18 @@ gcc_cplus_convert_symbol (void *datum,
} }
if (compile_debug && !found) if (compile_debug && !found)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_convert_symbol \"%s\": lookup_symbol failed\n", "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
identifier); identifier);
if (compile_debug) if (compile_debug)
{ {
if (found) if (found)
fprintf_unfiltered (gdb_stdlog, "found type for %s\n", identifier); gdb_printf (gdb_stdlog, "found type for %s\n", identifier);
else else
{ {
fprintf_unfiltered (gdb_stdlog, "did not find type for %s\n", gdb_printf (gdb_stdlog, "did not find type for %s\n",
identifier); identifier);
} }
} }
@ -425,8 +425,8 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
int found = 0; int found = 0;
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"got oracle request for address of %s\n", identifier); "got oracle request for address of %s\n", identifier);
/* We can't allow exceptions to escape out of this callback. Safest /* We can't allow exceptions to escape out of this callback. Safest
is to simply emit a gcc error. */ is to simply emit a gcc error. */
@ -438,9 +438,9 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
if (sym != nullptr && sym->aclass () == LOC_BLOCK) if (sym != nullptr && sym->aclass () == LOC_BLOCK)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": full symbol\n", "gcc_symbol_address \"%s\": full symbol\n",
identifier); identifier);
result = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); result = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
if (sym->type ()->is_gnu_ifunc ()) if (sym->type ()->is_gnu_ifunc ())
result = gnu_ifunc_resolve_addr (target_gdbarch (), result); result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
@ -454,10 +454,10 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
if (msym.minsym != nullptr) if (msym.minsym != nullptr)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": minimal " "gcc_symbol_address \"%s\": minimal "
"symbol\n", "symbol\n",
identifier); identifier);
result = BMSYMBOL_VALUE_ADDRESS (msym); result = BMSYMBOL_VALUE_ADDRESS (msym);
if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc) if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
result = gnu_ifunc_resolve_addr (target_gdbarch (), result); result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
@ -472,17 +472,17 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
} }
if (compile_debug && !found) if (compile_debug && !found)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"gcc_symbol_address \"%s\": failed\n", "gcc_symbol_address \"%s\": failed\n",
identifier); identifier);
if (compile_debug) if (compile_debug)
{ {
if (found) if (found)
fprintf_unfiltered (gdb_stdlog, "found address for %s!\n", identifier); gdb_printf (gdb_stdlog, "found address for %s!\n", identifier);
else else
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"did not find address for %s\n", identifier); "did not find address for %s\n", identifier);
} }
return result; return result;

View file

@ -258,8 +258,8 @@ compile_cplus_instance::enter_scope (compile_scope &&new_scope)
{ {
if (debug_compile_cplus_scopes) if (debug_compile_cplus_scopes)
{ {
fprintf_unfiltered (gdb_stdlog, "entering new scope %s\n", gdb_printf (gdb_stdlog, "entering new scope %s\n",
host_address_to_string (&m_scopes.back ())); host_address_to_string (&m_scopes.back ()));
} }
/* Push the global namespace. */ /* Push the global namespace. */
@ -284,8 +284,8 @@ compile_cplus_instance::enter_scope (compile_scope &&new_scope)
{ {
if (debug_compile_cplus_scopes) if (debug_compile_cplus_scopes)
{ {
fprintf_unfiltered (gdb_stdlog, "staying in current scope -- " gdb_printf (gdb_stdlog, "staying in current scope -- "
"scopes are identical\n"); "scopes are identical\n");
} }
} }
} }
@ -305,8 +305,8 @@ compile_cplus_instance::leave_scope ()
{ {
if (debug_compile_cplus_scopes) if (debug_compile_cplus_scopes)
{ {
fprintf_unfiltered (gdb_stdlog, "leaving scope %s\n", gdb_printf (gdb_stdlog, "leaving scope %s\n",
host_address_to_string (&current)); host_address_to_string (&current));
} }
/* Pop namespaces. */ /* Pop namespaces. */
@ -324,8 +324,8 @@ compile_cplus_instance::leave_scope ()
else else
{ {
if (debug_compile_cplus_scopes) if (debug_compile_cplus_scopes)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"identical scopes -- not leaving scope\n"); "identical scopes -- not leaving scope\n");
} }
} }
@ -1239,7 +1239,7 @@ compile_cplus_instance::gcc_cplus_leave_scope
static void static void
compile_cplus_debug_output_1 (ULONGEST arg) compile_cplus_debug_output_1 (ULONGEST arg)
{ {
fprintf_unfiltered (gdb_stdlog, "%s", pulongest (arg)); gdb_printf (gdb_stdlog, "%s", pulongest (arg));
} }
static void static void
@ -1363,7 +1363,7 @@ gcc_cp_plugin::build_decl (const char *debug_decltype, const char *name,
const char *filename, unsigned int line_number) const char *filename, unsigned int line_number)
{ {
if (debug_compile_cplus_types) if (debug_compile_cplus_types)
fprintf_unfiltered (gdb_stdlog, "<%s> ", debug_decltype); gdb_printf (gdb_stdlog, "<%s> ", debug_decltype);
return build_decl (name, sym_kind, sym_type, substitution_name, return build_decl (name, sym_kind, sym_type, substitution_name,
address, filename, line_number); address, filename, line_number);
@ -1375,7 +1375,7 @@ gcc_cp_plugin::start_class_type (const char *debug_name, gcc_decl typedecl,
const char *filename, unsigned int line_number) const char *filename, unsigned int line_number)
{ {
if (debug_compile_cplus_types) if (debug_compile_cplus_types)
fprintf_unfiltered (gdb_stdlog, "<%s> ", debug_name); gdb_printf (gdb_stdlog, "<%s> ", debug_name);
return start_class_type (typedecl, base_classes, filename, line_number); return start_class_type (typedecl, base_classes, filename, line_number);
} }
@ -1385,7 +1385,7 @@ gcc_cp_plugin::finish_class_type (const char *debug_name,
unsigned long size_in_bytes) unsigned long size_in_bytes)
{ {
if (debug_compile_cplus_types) if (debug_compile_cplus_types)
fprintf_unfiltered (gdb_stdlog, "<%s> ", debug_name); gdb_printf (gdb_stdlog, "<%s> ", debug_name);
return finish_class_type (size_in_bytes); return finish_class_type (size_in_bytes);
} }
@ -1394,7 +1394,7 @@ int
gcc_cp_plugin::pop_binding_level (const char *debug_name) gcc_cp_plugin::pop_binding_level (const char *debug_name)
{ {
if (debug_compile_cplus_types) if (debug_compile_cplus_types)
fprintf_unfiltered (gdb_stdlog, "<%s> ", debug_name); gdb_printf (gdb_stdlog, "<%s> ", debug_name);
return pop_binding_level (); return pop_binding_level ();
} }

View file

@ -435,9 +435,9 @@ compute_stack_depth (enum bfd_endian byte_order, unsigned int addr_size,
static void static void
push (int indent, string_file *stream, ULONGEST l) push (int indent, string_file *stream, ULONGEST l)
{ {
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n", "%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
indent, "", hex_string (l)); indent, "", hex_string (l));
} }
/* Emit code to push an arbitrary expression. This works like /* Emit code to push an arbitrary expression. This works like
@ -451,13 +451,13 @@ pushf (int indent, string_file *stream, const char *format, ...)
{ {
va_list args; va_list args;
fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos + 1] = ", indent, ""); gdb_printf (stream, "%*s__gdb_stack[__gdb_tos + 1] = ", indent, "");
va_start (args, format); va_start (args, format);
stream->vprintf (format, args); stream->vprintf (format, args);
va_end (args); va_end (args);
stream->puts (";\n"); stream->puts (";\n");
fprintf_filtered (stream, "%*s++__gdb_tos;\n", indent, ""); gdb_printf (stream, "%*s++__gdb_tos;\n", indent, "");
} }
/* Emit code for a unary expression -- one which operates in-place on /* Emit code for a unary expression -- one which operates in-place on
@ -471,7 +471,7 @@ unary (int indent, string_file *stream, const char *format, ...)
{ {
va_list args; va_list args;
fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos] = ", indent, ""); gdb_printf (stream, "%*s__gdb_stack[__gdb_tos] = ", indent, "");
va_start (args, format); va_start (args, format);
stream->vprintf (format, args); stream->vprintf (format, args);
va_end (args); va_end (args);
@ -488,12 +488,12 @@ binary (int indent, string_file *stream, const char *format, ...)
{ {
va_list args; va_list args;
fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 1] = ", indent, ""); gdb_printf (stream, "%*s__gdb_stack[__gdb_tos - 1] = ", indent, "");
va_start (args, format); va_start (args, format);
stream->vprintf (format, args); stream->vprintf (format, args);
va_end (args); va_end (args);
stream->puts (";\n"); stream->puts (";\n");
fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, ""); gdb_printf (stream, "%*s--__gdb_tos;\n", indent, "");
} }
/* Print the name of a label given its "SCOPE", an arbitrary integer /* Print the name of a label given its "SCOPE", an arbitrary integer
@ -614,9 +614,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
++scope; ++scope;
fprintf_filtered (stream, "%*s__attribute__ ((unused)) %s %s;\n", gdb_printf (stream, "%*s__attribute__ ((unused)) %s %s;\n",
indent, "", type_name, result_name); indent, "", type_name, result_name);
fprintf_filtered (stream, "%*s{\n", indent, ""); gdb_printf (stream, "%*s{\n", indent, "");
indent += 2; indent += 2;
stack_depth = compute_stack_depth (byte_order, addr_size, stack_depth = compute_stack_depth (byte_order, addr_size,
@ -652,19 +652,19 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
"compiled code."), "compiled code."),
sym->print_name ()); sym->print_name ());
fprintf_filtered (stream, "%*s%s = %s;\n", gdb_printf (stream, "%*s%s = %s;\n",
indent, "", result_name, indent, "", result_name,
core_addr_to_string (value_address (val))); core_addr_to_string (value_address (val)));
fprintf_filtered (stream, "%*s}\n", indent - 2, ""); gdb_printf (stream, "%*s}\n", indent - 2, "");
return; return;
} }
fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n", gdb_printf (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n",
indent, "", stack_depth); indent, "", stack_depth);
if (need_tempvar) if (need_tempvar)
fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, ""); gdb_printf (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, "");
fprintf_filtered (stream, "%*sint __gdb_tos = -1;\n", indent, ""); gdb_printf (stream, "%*sint __gdb_tos = -1;\n", indent, "");
if (initial != NULL) if (initial != NULL)
pushf (indent, stream, "%s", core_addr_to_string (*initial)); pushf (indent, stream, "%s", core_addr_to_string (*initial));
@ -684,8 +684,8 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
stream->printf ("/* %s */\n", get_DW_OP_name (op)); stream->printf ("/* %s */\n", get_DW_OP_name (op));
/* This is handy for debugging the generated code: /* This is handy for debugging the generated code:
fprintf_filtered (stream, "if (__gdb_tos != %d) abort ();\n", gdb_printf (stream, "if (__gdb_tos != %d) abort ();\n",
(int) info[op_ptr - base].depth - 1); (int) info[op_ptr - base].depth - 1);
*/ */
++op_ptr; ++op_ptr;
@ -923,7 +923,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break; break;
case DW_OP_drop: case DW_OP_drop:
fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, ""); gdb_printf (stream, "%*s--__gdb_tos;\n", indent, "");
break; break;
case DW_OP_pick: case DW_OP_pick:
@ -933,16 +933,16 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break; break;
case DW_OP_swap: case DW_OP_swap:
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n", "%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n",
indent, ""); indent, "");
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_stack[__gdb_tos - 1] = " "%*s__gdb_stack[__gdb_tos - 1] = "
"__gdb_stack[__gdb_tos];\n", "__gdb_stack[__gdb_tos];\n",
indent, ""); indent, "");
fprintf_filtered (stream, ("%*s__gdb_stack[__gdb_tos] = " gdb_printf (stream, ("%*s__gdb_stack[__gdb_tos] = "
"__gdb_tmp;\n"), "__gdb_tmp;\n"),
indent, ""); indent, "");
break; break;
case DW_OP_over: case DW_OP_over:
@ -950,20 +950,20 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break; break;
case DW_OP_rot: case DW_OP_rot:
fprintf_filtered (stream, ("%*s__gdb_tmp = " gdb_printf (stream, ("%*s__gdb_tmp = "
"__gdb_stack[__gdb_tos];\n"), "__gdb_stack[__gdb_tos];\n"),
indent, ""); indent, "");
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_stack[__gdb_tos] = " "%*s__gdb_stack[__gdb_tos] = "
"__gdb_stack[__gdb_tos - 1];\n", "__gdb_stack[__gdb_tos - 1];\n",
indent, ""); indent, "");
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_stack[__gdb_tos - 1] = " "%*s__gdb_stack[__gdb_tos - 1] = "
"__gdb_stack[__gdb_tos -2];\n", "__gdb_stack[__gdb_tos -2];\n",
indent, ""); indent, "");
fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 2] = " gdb_printf (stream, "%*s__gdb_stack[__gdb_tos - 2] = "
"__gdb_tmp;\n", "__gdb_tmp;\n",
indent, ""); indent, "");
break; break;
case DW_OP_deref: case DW_OP_deref:
@ -984,11 +984,11 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
/* Cast to a pointer of the desired type, then /* Cast to a pointer of the desired type, then
dereference. */ dereference. */
fprintf_filtered (stream, gdb_printf (stream,
"%*s__gdb_stack[__gdb_tos] = " "%*s__gdb_stack[__gdb_tos] = "
"*((__gdb_int_%s *) " "*((__gdb_int_%s *) "
"__gdb_stack[__gdb_tos]);\n", "__gdb_stack[__gdb_tos]);\n",
indent, "", mode); indent, "", mode);
} }
break; break;
@ -1110,7 +1110,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
case DW_OP_skip: case DW_OP_skip:
offset = extract_signed_integer (op_ptr, 2, byte_order); offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2; op_ptr += 2;
fprintf_filtered (stream, "%*sgoto ", indent, ""); gdb_printf (stream, "%*sgoto ", indent, "");
print_label (stream, scope, op_ptr + offset - base); print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n"); stream->puts (";\n");
break; break;
@ -1118,10 +1118,10 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
case DW_OP_bra: case DW_OP_bra:
offset = extract_signed_integer (op_ptr, 2, byte_order); offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2; op_ptr += 2;
fprintf_filtered (stream, gdb_printf (stream,
"%*sif ((( " GCC_INTPTR "%*sif ((( " GCC_INTPTR
") __gdb_stack[__gdb_tos--]) != 0) goto ", ") __gdb_stack[__gdb_tos--]) != 0) goto ",
indent, ""); indent, "");
print_label (stream, scope, op_ptr + offset - base); print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n"); stream->puts (";\n");
break; break;
@ -1134,9 +1134,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
} }
} }
fprintf_filtered (stream, "%*s%s = __gdb_stack[__gdb_tos];\n", gdb_printf (stream, "%*s%s = __gdb_stack[__gdb_tos];\n",
indent, "", result_name); indent, "", result_name);
fprintf_filtered (stream, "%*s}\n", indent - 2, ""); gdb_printf (stream, "%*s}\n", indent - 2, "");
} }
/* See compile.h. */ /* See compile.h. */

View file

@ -126,13 +126,13 @@ setup_sections_data::setup_one_section (asection *sect)
prot |= GDB_MMAP_PROT_EXEC; prot |= GDB_MMAP_PROT_EXEC;
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"module \"%s\" section \"%s\" size %s prot %u\n", "module \"%s\" section \"%s\" size %s prot %u\n",
bfd_get_filename (m_bfd), bfd_get_filename (m_bfd),
bfd_section_name (sect), bfd_section_name (sect),
paddress (target_gdbarch (), paddress (target_gdbarch (),
bfd_section_size (sect)), bfd_section_size (sect)),
prot); prot);
} }
else else
prot = -1; prot = -1;
@ -149,11 +149,11 @@ setup_sections_data::setup_one_section (asection *sect)
m_last_prot); m_last_prot);
munmap_list.add (addr, m_last_size); munmap_list.add (addr, m_last_size);
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"allocated %s bytes at %s prot %u\n", "allocated %s bytes at %s prot %u\n",
paddress (target_gdbarch (), m_last_size), paddress (target_gdbarch (), m_last_size),
paddress (target_gdbarch (), addr), paddress (target_gdbarch (), addr),
m_last_prot); m_last_prot);
} }
else else
addr = 0; addr = 0;
@ -713,9 +713,9 @@ compile_object_load (const compile_file_names &file_names,
if (strcmp (sym->name, "_GLOBAL_OFFSET_TABLE_") == 0) if (strcmp (sym->name, "_GLOBAL_OFFSET_TABLE_") == 0)
{ {
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"ELF symbol \"%s\" relocated to zero\n", "ELF symbol \"%s\" relocated to zero\n",
sym->name); sym->name);
/* It seems to be a GCC bug, with -mcmodel=large there should be no /* It seems to be a GCC bug, with -mcmodel=large there should be no
need for _GLOBAL_OFFSET_TABLE_. Together with -fPIE the data need for _GLOBAL_OFFSET_TABLE_. Together with -fPIE the data
@ -757,10 +757,10 @@ compile_object_load (const compile_file_names &file_names,
sym->value = 0x8000; sym->value = 0x8000;
bfd_set_gp_value(abfd.get(), toc_fallback->vma); bfd_set_gp_value(abfd.get(), toc_fallback->vma);
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Connectiong ELF symbol \"%s\" to the .toc section (%s)\n", "Connectiong ELF symbol \"%s\" to the .toc section (%s)\n",
sym->name, sym->name,
paddress (target_gdbarch (), sym->value)); paddress (target_gdbarch (), sym->value));
continue; continue;
} }
@ -773,20 +773,20 @@ compile_object_load (const compile_file_names &file_names,
case mst_data: case mst_data:
sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym); sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym);
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"ELF mst_text symbol \"%s\" relocated to %s\n", "ELF mst_text symbol \"%s\" relocated to %s\n",
sym->name, sym->name,
paddress (target_gdbarch (), sym->value)); paddress (target_gdbarch (), sym->value));
break; break;
case mst_text_gnu_ifunc: case mst_text_gnu_ifunc:
sym->value = gnu_ifunc_resolve_addr (target_gdbarch (), sym->value = gnu_ifunc_resolve_addr (target_gdbarch (),
BMSYMBOL_VALUE_ADDRESS (bmsym)); BMSYMBOL_VALUE_ADDRESS (bmsym));
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"ELF mst_text_gnu_ifunc symbol \"%s\" " "ELF mst_text_gnu_ifunc symbol \"%s\" "
"relocated to %s\n", "relocated to %s\n",
sym->name, sym->name,
paddress (target_gdbarch (), sym->value)); paddress (target_gdbarch (), sym->value));
break; break;
default: default:
warning (_("Could not find symbol \"%s\" " warning (_("Could not find symbol \"%s\" "
@ -812,11 +812,11 @@ compile_object_load (const compile_file_names &file_names,
gdb_assert (regs_addr != 0); gdb_assert (regs_addr != 0);
setup_sections_data.munmap_list.add (regs_addr, TYPE_LENGTH (regs_type)); setup_sections_data.munmap_list.add (regs_addr, TYPE_LENGTH (regs_type));
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"allocated %s bytes at %s for registers\n", "allocated %s bytes at %s for registers\n",
paddress (target_gdbarch (), paddress (target_gdbarch (),
TYPE_LENGTH (regs_type)), TYPE_LENGTH (regs_type)),
paddress (target_gdbarch (), regs_addr)); paddress (target_gdbarch (), regs_addr));
store_regs (regs_type, regs_addr); store_regs (regs_type, regs_addr);
} }
@ -835,11 +835,11 @@ compile_object_load (const compile_file_names &file_names,
setup_sections_data.munmap_list.add (out_value_addr, setup_sections_data.munmap_list.add (out_value_addr,
TYPE_LENGTH (out_value_type)); TYPE_LENGTH (out_value_type));
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"allocated %s bytes at %s for printed value\n", "allocated %s bytes at %s for printed value\n",
paddress (target_gdbarch (), paddress (target_gdbarch (),
TYPE_LENGTH (out_value_type)), TYPE_LENGTH (out_value_type)),
paddress (target_gdbarch (), out_value_addr)); paddress (target_gdbarch (), out_value_addr));
} }
compile_module_up retval (new struct compile_module); compile_module_up retval (new struct compile_module);

View file

@ -233,7 +233,7 @@ static void
show_compile_debug (struct ui_file *file, int from_tty, show_compile_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Compile debugging is %s.\n"), value); gdb_printf (file, _("Compile debugging is %s.\n"), value);
} }
@ -530,9 +530,9 @@ static void
show_compile_args (struct ui_file *file, int from_tty, show_compile_args (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Compile command command-line arguments " gdb_printf (file, _("Compile command command-line arguments "
"are \"%s\".\n"), "are \"%s\".\n"),
value); value);
} }
/* String for 'set compile-gcc' and 'show compile-gcc'. */ /* String for 'set compile-gcc' and 'show compile-gcc'. */
@ -544,8 +544,8 @@ static void
show_compile_gcc (struct ui_file *file, int from_tty, show_compile_gcc (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Compile command GCC driver filename is \"%s\".\n"), gdb_printf (file, _("Compile command GCC driver filename is \"%s\".\n"),
value); value);
} }
/* Return DW_AT_producer parsed for get_selected_frame () (if any). /* Return DW_AT_producer parsed for get_selected_frame () (if any).
@ -708,7 +708,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
= current_language->compute_program (compiler.get (), input, gdbarch, = current_language->compute_program (compiler.get (), input, gdbarch,
expr_block, expr_pc); expr_block, expr_pc);
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, "debug output:\n\n%s", code.c_str ()); gdb_printf (gdb_stdlog, "debug output:\n\n%s", code.c_str ());
compiler->set_verbose (compile_debug); compiler->set_verbose (compile_debug);
@ -747,10 +747,10 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
{ {
int argi; int argi;
fprintf_unfiltered (gdb_stdlog, "Passing %d compiler options:\n", argc); gdb_printf (gdb_stdlog, "Passing %d compiler options:\n", argc);
for (argi = 0; argi < argc; argi++) for (argi = 0; argi < argc; argi++)
fprintf_unfiltered (gdb_stdlog, "Compiler option %d: <%s>\n", gdb_printf (gdb_stdlog, "Compiler option %d: <%s>\n",
argi, argv[argi]); argi, argv[argi]);
} }
compile_file_names fnames = get_new_file_names (); compile_file_names fnames = get_new_file_names ();
@ -769,8 +769,8 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
} }
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, "source file produced: %s\n\n", gdb_printf (gdb_stdlog, "source file produced: %s\n\n",
fnames.source_file ()); fnames.source_file ());
/* If we don't do this, then GDB simply exits /* If we don't do this, then GDB simply exits
when the compiler dies. */ when the compiler dies. */
@ -783,8 +783,8 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
error (_("Compilation failed.")); error (_("Compilation failed."));
if (compile_debug) if (compile_debug)
fprintf_unfiltered (gdb_stdlog, "object file produced: %s\n\n", gdb_printf (gdb_stdlog, "object file produced: %s\n\n",
fnames.object_file ()); fnames.object_file ());
/* Keep the source file. */ /* Keep the source file. */
source_remover->keep (); source_remover->keep ();

View file

@ -70,9 +70,9 @@ static void
complaints_show_value (struct ui_file *file, int from_tty, complaints_show_value (struct ui_file *file, int from_tty,
struct cmd_list_element *cmd, const char *value) struct cmd_list_element *cmd, const char *value)
{ {
fprintf_filtered (file, _("Max number of complaints about incorrect" gdb_printf (file, _("Max number of complaints about incorrect"
" symbols is %s.\n"), " symbols is %s.\n"),
value); value);
} }
#if GDB_SELF_TEST #if GDB_SELF_TEST

View file

@ -21,11 +21,11 @@ BEGIN {
NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ { NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
if ($0 ~ / /) if ($0 ~ / /)
{ {
printf " printf_filtered (\"\\n\");\n"; printf " gdb_printf (\"\\n\");\n";
} }
else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/) else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/)
{ {
printf " printf_filtered (\""; printf " gdb_printf (\"";
for (i = 1; i < NF; i++) for (i = 1; i < NF; i++)
printf "%s\\\"", $i; printf "%s\\\"", $i;
printf "%s\\n\");\n", $NF; printf "%s\\n\");\n", $NF;
@ -41,7 +41,7 @@ NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ {
/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/)) if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
{ {
printf " printf_filtered (\""; printf " gdb_printf (\"";
for (i = 1; i < NF; i++) for (i = 1; i < NF; i++)
printf "%s\\\"", $i; printf "%s\\\"", $i;
printf "%s\\n\");\n", $NF; printf "%s\\n\");\n", $NF;

File diff suppressed because it is too large Load diff

View file

@ -401,8 +401,8 @@ show_gnutarget_string (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("The current BFD target is \"%s\".\n"), value); _("The current BFD target is \"%s\".\n"), value);
} }
static void static void

View file

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

View file

@ -509,11 +509,11 @@ cp_lookup_symbol_imports_or_template (const char *scope,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_imports_or_template" "cp_lookup_symbol_imports_or_template"
" (%s, %s, %s, %s)\n", " (%s, %s, %s, %s)\n",
scope, name, host_address_to_string (block), scope, name, host_address_to_string (block),
domain_name (domain)); domain_name (domain));
} }
if (function != NULL && function->language () == language_cplus) if (function != NULL && function->language () == language_cplus)
@ -531,10 +531,10 @@ cp_lookup_symbol_imports_or_template (const char *scope,
{ {
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_imports_or_template" "cp_lookup_symbol_imports_or_template"
" (...) = %s\n", " (...) = %s\n",
host_address_to_string (sym)); host_address_to_string (sym));
} }
return (struct block_symbol) {sym, block}; return (struct block_symbol) {sym, block};
} }
@ -576,7 +576,7 @@ cp_lookup_symbol_imports_or_template (const char *scope,
{ {
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered gdb_printf
(gdb_stdlog, (gdb_stdlog,
"cp_lookup_symbol_imports_or_template (...) = %s\n", "cp_lookup_symbol_imports_or_template (...) = %s\n",
host_address_to_string (sym)); host_address_to_string (sym));
@ -590,10 +590,10 @@ cp_lookup_symbol_imports_or_template (const char *scope,
result = cp_lookup_symbol_via_imports (scope, name, block, domain, 0, 1, 1); result = cp_lookup_symbol_via_imports (scope, name, block, domain, 0, 1, 1);
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_imports_or_template (...) = %s\n", "cp_lookup_symbol_imports_or_template (...) = %s\n",
result.symbol != NULL result.symbol != NULL
? host_address_to_string (result.symbol) : "NULL"); ? host_address_to_string (result.symbol) : "NULL");
} }
return result; return result;
} }
@ -636,10 +636,10 @@ cp_lookup_symbol_namespace (const char *scope,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_namespace (%s, %s, %s, %s)\n", "cp_lookup_symbol_namespace (%s, %s, %s, %s)\n",
scope, name, host_address_to_string (block), scope, name, host_address_to_string (block),
domain_name (domain)); domain_name (domain));
} }
/* First, try to find the symbol in the given namespace. */ /* First, try to find the symbol in the given namespace. */
@ -651,10 +651,10 @@ cp_lookup_symbol_namespace (const char *scope,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_namespace (...) = %s\n", "cp_lookup_symbol_namespace (...) = %s\n",
sym.symbol != NULL sym.symbol != NULL
? host_address_to_string (sym.symbol) : "NULL"); ? host_address_to_string (sym.symbol) : "NULL");
} }
return sym; return sym;
} }
@ -742,11 +742,11 @@ cp_lookup_symbol_nonlocal (const struct language_defn *langdef,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_non_local" "cp_lookup_symbol_non_local"
" (%s, %s (scope %s), %s)\n", " (%s, %s (scope %s), %s)\n",
name, host_address_to_string (block), scope, name, host_address_to_string (block), scope,
domain_name (domain)); domain_name (domain));
} }
/* First, try to find the symbol in the given namespace, and all /* First, try to find the symbol in the given namespace, and all
@ -759,11 +759,11 @@ cp_lookup_symbol_nonlocal (const struct language_defn *langdef,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_symbol_nonlocal (...) = %s\n", "cp_lookup_symbol_nonlocal (...) = %s\n",
(sym.symbol != NULL (sym.symbol != NULL
? host_address_to_string (sym.symbol) ? host_address_to_string (sym.symbol)
: "NULL")); : "NULL"));
} }
return sym; return sym;
} }
@ -920,11 +920,11 @@ cp_lookup_nested_symbol (struct type *parent_type,
{ {
const char *type_name = saved_parent_type->name (); const char *type_name = saved_parent_type->name ();
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_nested_symbol (%s, %s, %s, %s)\n", "cp_lookup_nested_symbol (%s, %s, %s, %s)\n",
type_name != NULL ? type_name : "unnamed", type_name != NULL ? type_name : "unnamed",
nested_name, host_address_to_string (block), nested_name, host_address_to_string (block),
domain_name (domain)); domain_name (domain));
} }
switch (parent_type->code ()) switch (parent_type->code ())
@ -956,11 +956,11 @@ cp_lookup_nested_symbol (struct type *parent_type,
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_nested_symbol (...) = %s\n", "cp_lookup_nested_symbol (...) = %s\n",
(sym.symbol != NULL (sym.symbol != NULL
? host_address_to_string (sym.symbol) ? host_address_to_string (sym.symbol)
: "NULL")); : "NULL"));
} }
return sym; return sym;
} }
@ -969,9 +969,9 @@ cp_lookup_nested_symbol (struct type *parent_type,
case TYPE_CODE_METHOD: case TYPE_CODE_METHOD:
if (symbol_lookup_debug) if (symbol_lookup_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"cp_lookup_nested_symbol (...) = NULL" "cp_lookup_nested_symbol (...) = NULL"
" (func/method)\n"); " (func/method)\n");
} }
return {}; return {};
@ -1058,7 +1058,7 @@ cp_lookup_transparent_type_loop (const char *name,
static void static void
maintenance_cplus_namespace (const char *args, int from_tty) maintenance_cplus_namespace (const char *args, int from_tty)
{ {
printf_filtered (_("The `maint namespace' command was removed.\n")); gdb_printf (_("The `maint namespace' command was removed.\n"));
} }
void _initialize_cp_namespace (); void _initialize_cp_namespace ();

View file

@ -1583,9 +1583,9 @@ report_failed_demangle (const char *name, bool core_dump_allowed,
begin_line (); begin_line ();
if (core_dump_allowed) if (core_dump_allowed)
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
_("%s\nAttempting to dump core.\n"), _("%s\nAttempting to dump core.\n"),
long_msg.c_str ()); long_msg.c_str ());
else else
warn_cant_dump_core (long_msg.c_str ()); warn_cant_dump_core (long_msg.c_str ());
@ -2191,7 +2191,7 @@ first_component_command (const char *arg, int from_tty)
memcpy (prefix, arg, len); memcpy (prefix, arg, len);
prefix[len] = '\0'; prefix[len] = '\0';
printf_filtered ("%s\n", prefix); gdb_printf ("%s\n", prefix);
} }
/* Implement "info vtbl". */ /* Implement "info vtbl". */

View file

@ -150,7 +150,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
} }
} }
fprintf_filtered (stream, "{"); gdb_printf (stream, "{");
len = type->num_fields (); len = type->num_fields ();
n_baseclasses = TYPE_N_BASECLASSES (type); n_baseclasses = TYPE_N_BASECLASSES (type);
@ -206,7 +206,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
{ {
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
gdb_puts ("members of ", stream); gdb_puts ("members of ", stream);
gdb_puts (type->name (), stream); gdb_puts (type->name (), stream);
@ -217,7 +217,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces_filtered (2 + 2 * recurse, stream);
} }
else else
@ -373,12 +373,12 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
} /* if there are data fields */ } /* if there are data fields */
fprintf_filtered (stream, "}"); gdb_printf (stream, "}");
} }
/* Special val_print routine to avoid printing multiple copies of /* Special val_print routine to avoid printing multiple copies of
@ -478,7 +478,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
/* Now do the printing. */ /* Now do the printing. */
if (options->prettyformat) if (options->prettyformat)
{ {
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
gdb_puts ("<", stream); gdb_puts ("<", stream);
@ -691,7 +691,7 @@ cp_print_class_member (const gdb_byte *valaddr, struct type *type,
if (val == -1) if (val == -1)
{ {
fprintf_filtered (stream, "NULL"); gdb_printf (stream, "NULL");
return; return;
} }
@ -707,12 +707,12 @@ cp_print_class_member (const gdb_byte *valaddr, struct type *type,
gdb_puts (name, stream); gdb_puts (name, stream);
else else
c_type_print_base (self_type, stream, 0, 0, &type_print_raw_options); c_type_print_base (self_type, stream, 0, 0, &type_print_raw_options);
fprintf_filtered (stream, "::"); gdb_printf (stream, "::");
fputs_styled (self_type->field (fieldno).name (), fputs_styled (self_type->field (fieldno).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
} }
else else
fprintf_filtered (stream, "%ld", (long) val); gdb_printf (stream, "%ld", (long) val);
} }
#if GDB_SELF_TEST #if GDB_SELF_TEST

View file

@ -3792,7 +3792,7 @@ cris_supply_gregset (const struct regset *regset, struct regcache *regcache,
(char *)&regp[ERP_REGNUM]); (char *)&regp[ERP_REGNUM]);
if (*(char *)&regp[ERP_REGNUM] & 0x1) if (*(char *)&regp[ERP_REGNUM] & 0x1)
fprintf_unfiltered (gdb_stderr, "Warning: PC in delay slot\n"); gdb_printf (gdb_stderr, "Warning: PC in delay slot\n");
} }
} }
@ -3863,12 +3863,12 @@ cris_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
cris_gdbarch_tdep *tdep = (cris_gdbarch_tdep *) gdbarch_tdep (gdbarch); cris_gdbarch_tdep *tdep = (cris_gdbarch_tdep *) gdbarch_tdep (gdbarch);
if (tdep != NULL) if (tdep != NULL)
{ {
fprintf_filtered (file, "cris_dump_tdep: tdep->cris_version = %i\n", gdb_printf (file, "cris_dump_tdep: tdep->cris_version = %i\n",
tdep->cris_version); tdep->cris_version);
fprintf_filtered (file, "cris_dump_tdep: tdep->cris_mode = %s\n", gdb_printf (file, "cris_dump_tdep: tdep->cris_mode = %s\n",
tdep->cris_mode); tdep->cris_mode);
fprintf_filtered (file, "cris_dump_tdep: tdep->cris_dwarf2_cfi = %i\n", gdb_printf (file, "cris_dump_tdep: tdep->cris_dwarf2_cfi = %i\n",
tdep->cris_dwarf2_cfi); tdep->cris_dwarf2_cfi);
} }
} }

View file

@ -72,10 +72,10 @@ static struct reggroup *prof_reggroup;
static void static void
print_savedreg_msg (int regno, int offsets[], bool print_continuing) print_savedreg_msg (int regno, int offsets[], bool print_continuing)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: r%d saved at offset 0x%x\n", gdb_printf (gdb_stdlog, "csky: r%d saved at offset 0x%x\n",
regno, offsets[regno]); regno, offsets[regno]);
if (print_continuing) if (print_continuing)
fprintf_unfiltered (gdb_stdlog, "csky: continuing\n"); gdb_printf (gdb_stdlog, "csky: continuing\n");
} }
/* Check whether the instruction at ADDR is 16-bit or not. */ /* Check whether the instruction at ADDR is 16-bit or not. */
@ -342,10 +342,10 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{ {
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: struct return in %s = %s\n", "csky: struct return in %s = %s\n",
gdbarch_register_name (gdbarch, argreg), gdbarch_register_name (gdbarch, argreg),
paddress (gdbarch, struct_addr)); paddress (gdbarch, struct_addr));
} }
regcache_cooked_write_unsigned (regcache, argreg, struct_addr); regcache_cooked_write_unsigned (regcache, argreg, struct_addr);
argreg++; argreg++;
@ -533,10 +533,10 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
saved (and where). */ saved (and where). */
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: Scanning prologue: start_pc = 0x%x," "csky: Scanning prologue: start_pc = 0x%x,"
"limit_pc = 0x%x\n", (unsigned int) start_pc, "limit_pc = 0x%x\n", (unsigned int) start_pc,
(unsigned int) limit_pc); (unsigned int) limit_pc);
} }
/* Default to 16 bit instruction. */ /* Default to 16 bit instruction. */
@ -557,9 +557,9 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset = CSKY_32_SUBI_IMM (insn); int offset = CSKY_32_SUBI_IMM (insn);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: got subi sp,%d; continuing\n", "csky: got subi sp,%d; continuing\n",
offset); offset);
} }
stacksize += offset; stacksize += offset;
continue; continue;
@ -583,10 +583,10 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
reg_count = CSKY_32_STM_SIZE (insn); reg_count = CSKY_32_STM_SIZE (insn);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: got stm r%d-r%d,(sp)\n", "csky: got stm r%d-r%d,(sp)\n",
start_register, start_register,
start_register + reg_count); start_register + reg_count);
} }
for (rn = start_register, offset = 0; for (rn = start_register, offset = 0;
@ -596,15 +596,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
register_offsets[rn] = stacksize - offset; register_offsets[rn] = stacksize - offset;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: r%d saved at 0x%x" "csky: r%d saved at 0x%x"
" (offset %d)\n", " (offset %d)\n",
rn, register_offsets[rn], rn, register_offsets[rn],
offset); offset);
} }
} }
if (csky_debug) if (csky_debug)
fprintf_unfiltered (gdb_stdlog, "csky: continuing\n"); gdb_printf (gdb_stdlog, "csky: continuing\n");
continue; continue;
} }
/* stw ry,(sp,disp). */ /* stw ry,(sp,disp). */
@ -814,19 +814,19 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
stacksize += num * 4; stacksize += num * 4;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: push regs_array: r16-r%d\n", "csky: push regs_array: r16-r%d\n",
16 + num - 1); 16 + num - 1);
} }
for (rn = 16; rn <= 16 + num - 1; rn++) for (rn = 16; rn <= 16 + num - 1; rn++)
{ {
register_offsets[rn] = stacksize - tmp; register_offsets[rn] = stacksize - tmp;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: r%d saved at 0x%x" "csky: r%d saved at 0x%x"
" (offset %d)\n", rn, " (offset %d)\n", rn,
register_offsets[rn], tmp); register_offsets[rn], tmp);
} }
tmp += 4; tmp += 4;
} }
@ -845,19 +845,19 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
stacksize += num * 4; stacksize += num * 4;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: push regs_array: r4-r%d\n", "csky: push regs_array: r4-r%d\n",
4 + num - 1); 4 + num - 1);
} }
for (rn = 4; rn <= 4 + num - 1; rn++) for (rn = 4; rn <= 4 + num - 1; rn++)
{ {
register_offsets[rn] = stacksize - tmp; register_offsets[rn] = stacksize - tmp;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: r%d saved at 0x%x" "csky: r%d saved at 0x%x"
" (offset %d)\n", rn, " (offset %d)\n", rn,
register_offsets[rn], tmp); register_offsets[rn], tmp);
} }
tmp += 4; tmp += 4;
} }
@ -865,7 +865,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
framesize = stacksize; framesize = stacksize;
if (csky_debug) if (csky_debug)
fprintf_unfiltered (gdb_stdlog, "csky: continuing\n"); gdb_printf (gdb_stdlog, "csky: continuing\n");
continue; continue;
} }
else if (CSKY_32_IS_LRW4 (insn) || CSKY_32_IS_MOVI4 (insn) else if (CSKY_32_IS_LRW4 (insn) || CSKY_32_IS_MOVI4 (insn)
@ -877,8 +877,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: looking at large frame\n"); "csky: looking at large frame\n");
} }
if (CSKY_32_IS_LRW4 (insn)) if (CSKY_32_IS_LRW4 (insn))
{ {
@ -900,12 +900,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: base stacksize=0x%x\n", adjust); "csky: base stacksize=0x%x\n", adjust);
/* May have zero or more insns which modify r4. */ /* May have zero or more insns which modify r4. */
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: looking for r4 adjusters...\n"); "csky: looking for r4 adjusters...\n");
} }
offset = 4; offset = 4;
@ -918,8 +918,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm; adjust += imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: addi r4,%d\n", imm); "csky: addi r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_SUBI4 (insn2)) else if (CSKY_32_IS_SUBI4 (insn2))
@ -928,8 +928,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm; adjust -= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: subi r4,%d\n", imm); "csky: subi r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_NOR4 (insn2)) else if (CSKY_32_IS_NOR4 (insn2))
@ -937,8 +937,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust; adjust = ~adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: nor r4,r4,r4\n"); "csky: nor r4,r4,r4\n");
} }
} }
else if (CSKY_32_IS_ROTLI4 (insn2)) else if (CSKY_32_IS_ROTLI4 (insn2))
@ -949,8 +949,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= temp; adjust |= temp;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: rotli r4,r4,%d\n", imm); "csky: rotli r4,r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_LISI4 (insn2)) else if (CSKY_32_IS_LISI4 (insn2))
@ -959,8 +959,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm; adjust <<= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: lsli r4,r4,%d\n", imm); "csky: lsli r4,r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_BSETI4 (insn2)) else if (CSKY_32_IS_BSETI4 (insn2))
@ -969,8 +969,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm); adjust |= (1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bseti r4,r4 %d\n", imm); "csky: bseti r4,r4 %d\n", imm);
} }
} }
else if (CSKY_32_IS_BCLRI4 (insn2)) else if (CSKY_32_IS_BCLRI4 (insn2))
@ -979,8 +979,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm); adjust &= ~(1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bclri r4,r4 %d\n", imm); "csky: bclri r4,r4 %d\n", imm);
} }
} }
else if (CSKY_32_IS_IXH4 (insn2)) else if (CSKY_32_IS_IXH4 (insn2))
@ -988,8 +988,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 3; adjust *= 3;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: ixh r4,r4,r4\n"); "csky: ixh r4,r4,r4\n");
} }
} }
else if (CSKY_32_IS_IXW4 (insn2)) else if (CSKY_32_IS_IXW4 (insn2))
@ -997,8 +997,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 5; adjust *= 5;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: ixw r4,r4,r4\n"); "csky: ixw r4,r4,r4\n");
} }
} }
else if (CSKY_16_IS_ADDI4 (insn2)) else if (CSKY_16_IS_ADDI4 (insn2))
@ -1007,8 +1007,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm; adjust += imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: addi r4,%d\n", imm); "csky: addi r4,%d\n", imm);
} }
} }
else if (CSKY_16_IS_SUBI4 (insn2)) else if (CSKY_16_IS_SUBI4 (insn2))
@ -1017,8 +1017,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm; adjust -= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: subi r4,%d\n", imm); "csky: subi r4,%d\n", imm);
} }
} }
else if (CSKY_16_IS_NOR4 (insn2)) else if (CSKY_16_IS_NOR4 (insn2))
@ -1026,8 +1026,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust; adjust = ~adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: nor r4,r4\n"); "csky: nor r4,r4\n");
} }
} }
else if (CSKY_16_IS_BSETI4 (insn2)) else if (CSKY_16_IS_BSETI4 (insn2))
@ -1036,8 +1036,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm); adjust |= (1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bseti r4, %d\n", imm); "csky: bseti r4, %d\n", imm);
} }
} }
else if (CSKY_16_IS_BCLRI4 (insn2)) else if (CSKY_16_IS_BCLRI4 (insn2))
@ -1046,8 +1046,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm); adjust &= ~(1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bclri r4, %d\n", imm); "csky: bclri r4, %d\n", imm);
} }
} }
else if (CSKY_16_IS_LSLI4 (insn2)) else if (CSKY_16_IS_LSLI4 (insn2))
@ -1056,8 +1056,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm; adjust <<= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: lsli r4,r4, %d\n", imm); "csky: lsli r4,r4, %d\n", imm);
} }
} }
@ -1067,8 +1067,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: done looking for" gdb_printf (gdb_stdlog, "csky: done looking for"
" r4 adjusters\n"); " r4 adjusters\n");
} }
/* If the next insn adjusts the stack pointer, we keep /* If the next insn adjusts the stack pointer, we keep
@ -1080,14 +1080,14 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
stacksize += adjust; stacksize += adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: found stack adjustment of" "csky: found stack adjustment of"
" 0x%x bytes.\n", adjust); " 0x%x bytes.\n", adjust);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: skipping to new address %s\n", "csky: skipping to new address %s\n",
core_addr_to_string_nz (addr)); core_addr_to_string_nz (addr));
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: continuing\n"); "csky: continuing\n");
} }
continue; continue;
} }
@ -1096,9 +1096,9 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
anything. */ anything. */
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: no subu sp,sp,r4; NOT altering" "csky: no subu sp,sp,r4; NOT altering"
" stacksize.\n"); " stacksize.\n");
} }
break; break;
} }
@ -1113,9 +1113,9 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
int offset = CSKY_16_SUBI_IMM (insn); int offset = CSKY_16_SUBI_IMM (insn);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: got subi r0,%d; continuing\n", "csky: got subi r0,%d; continuing\n",
offset); offset);
} }
stacksize += offset; stacksize += offset;
continue; continue;
@ -1160,19 +1160,19 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
offset += num * 4; offset += num * 4;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: push regs_array: r4-r%d\n", "csky: push regs_array: r4-r%d\n",
4 + num - 1); 4 + num - 1);
} }
for (rn = 4; rn <= 4 + num - 1; rn++) for (rn = 4; rn <= 4 + num - 1; rn++)
{ {
register_offsets[rn] = stacksize - tmp; register_offsets[rn] = stacksize - tmp;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: r%d saved at 0x%x" "csky: r%d saved at 0x%x"
" (offset %d)\n", rn, " (offset %d)\n", rn,
register_offsets[rn], offset); register_offsets[rn], offset);
} }
tmp += 4; tmp += 4;
} }
@ -1180,7 +1180,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
framesize = stacksize; framesize = stacksize;
if (csky_debug) if (csky_debug)
fprintf_unfiltered (gdb_stdlog, "csky: continuing\n"); gdb_printf (gdb_stdlog, "csky: continuing\n");
continue; continue;
} }
else if (CSKY_16_IS_LRW4 (insn) || CSKY_16_IS_MOVI4 (insn)) else if (CSKY_16_IS_LRW4 (insn) || CSKY_16_IS_MOVI4 (insn))
@ -1190,8 +1190,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: looking at large frame\n"); "csky: looking at large frame\n");
} }
if (CSKY_16_IS_LRW4 (insn)) if (CSKY_16_IS_LRW4 (insn))
{ {
@ -1209,15 +1209,15 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: base stacksize=0x%x\n", adjust); "csky: base stacksize=0x%x\n", adjust);
} }
/* May have zero or more instructions which modify r4. */ /* May have zero or more instructions which modify r4. */
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: looking for r4 adjusters...\n"); "csky: looking for r4 adjusters...\n");
} }
int offset = 2; int offset = 2;
insn_len = csky_get_insn (gdbarch, addr + offset, &insn2); insn_len = csky_get_insn (gdbarch, addr + offset, &insn2);
@ -1229,8 +1229,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm; adjust += imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: addi r4,%d\n", imm); "csky: addi r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_SUBI4 (insn2)) else if (CSKY_32_IS_SUBI4 (insn2))
@ -1239,8 +1239,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm; adjust -= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: subi r4,%d\n", imm); "csky: subi r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_NOR4 (insn2)) else if (CSKY_32_IS_NOR4 (insn2))
@ -1248,8 +1248,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust; adjust = ~adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: nor r4,r4,r4\n"); "csky: nor r4,r4,r4\n");
} }
} }
else if (CSKY_32_IS_ROTLI4 (insn2)) else if (CSKY_32_IS_ROTLI4 (insn2))
@ -1260,8 +1260,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= temp; adjust |= temp;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: rotli r4,r4,%d\n", imm); "csky: rotli r4,r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_LISI4 (insn2)) else if (CSKY_32_IS_LISI4 (insn2))
@ -1270,8 +1270,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm; adjust <<= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: lsli r4,r4,%d\n", imm); "csky: lsli r4,r4,%d\n", imm);
} }
} }
else if (CSKY_32_IS_BSETI4 (insn2)) else if (CSKY_32_IS_BSETI4 (insn2))
@ -1280,8 +1280,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm); adjust |= (1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bseti r4,r4 %d\n", imm); "csky: bseti r4,r4 %d\n", imm);
} }
} }
else if (CSKY_32_IS_BCLRI4 (insn2)) else if (CSKY_32_IS_BCLRI4 (insn2))
@ -1290,8 +1290,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm); adjust &= ~(1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bclri r4,r4 %d\n", imm); "csky: bclri r4,r4 %d\n", imm);
} }
} }
else if (CSKY_32_IS_IXH4 (insn2)) else if (CSKY_32_IS_IXH4 (insn2))
@ -1299,8 +1299,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 3; adjust *= 3;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: ixh r4,r4,r4\n"); "csky: ixh r4,r4,r4\n");
} }
} }
else if (CSKY_32_IS_IXW4 (insn2)) else if (CSKY_32_IS_IXW4 (insn2))
@ -1308,8 +1308,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust *= 5; adjust *= 5;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: ixw r4,r4,r4\n"); "csky: ixw r4,r4,r4\n");
} }
} }
else if (CSKY_16_IS_ADDI4 (insn2)) else if (CSKY_16_IS_ADDI4 (insn2))
@ -1318,8 +1318,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust += imm; adjust += imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: addi r4,%d\n", imm); "csky: addi r4,%d\n", imm);
} }
} }
else if (CSKY_16_IS_SUBI4 (insn2)) else if (CSKY_16_IS_SUBI4 (insn2))
@ -1328,8 +1328,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust -= imm; adjust -= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: subi r4,%d\n", imm); "csky: subi r4,%d\n", imm);
} }
} }
else if (CSKY_16_IS_NOR4 (insn2)) else if (CSKY_16_IS_NOR4 (insn2))
@ -1337,8 +1337,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust = ~adjust; adjust = ~adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: nor r4,r4\n"); "csky: nor r4,r4\n");
} }
} }
else if (CSKY_16_IS_BSETI4 (insn2)) else if (CSKY_16_IS_BSETI4 (insn2))
@ -1347,8 +1347,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust |= (1 << imm); adjust |= (1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bseti r4, %d\n", imm); "csky: bseti r4, %d\n", imm);
} }
} }
else if (CSKY_16_IS_BCLRI4 (insn2)) else if (CSKY_16_IS_BCLRI4 (insn2))
@ -1357,8 +1357,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust &= ~(1 << imm); adjust &= ~(1 << imm);
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: bclri r4, %d\n", imm); "csky: bclri r4, %d\n", imm);
} }
} }
else if (CSKY_16_IS_LSLI4 (insn2)) else if (CSKY_16_IS_LSLI4 (insn2))
@ -1367,8 +1367,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
adjust <<= imm; adjust <<= imm;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"csky: lsli r4,r4, %d\n", imm); "csky: lsli r4,r4, %d\n", imm);
} }
} }
@ -1378,8 +1378,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: " gdb_printf (gdb_stdlog, "csky: "
"done looking for r4 adjusters\n"); "done looking for r4 adjusters\n");
} }
/* If the next instruction adjusts the stack pointer, we keep /* If the next instruction adjusts the stack pointer, we keep
@ -1391,13 +1391,13 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
stacksize += adjust; stacksize += adjust;
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: " gdb_printf (gdb_stdlog, "csky: "
"found stack adjustment of 0x%x" "found stack adjustment of 0x%x"
" bytes.\n", adjust); " bytes.\n", adjust);
fprintf_unfiltered (gdb_stdlog, "csky: " gdb_printf (gdb_stdlog, "csky: "
"skipping to new address %s\n", "skipping to new address %s\n",
core_addr_to_string_nz (addr)); core_addr_to_string_nz (addr));
fprintf_unfiltered (gdb_stdlog, "csky: continuing\n"); gdb_printf (gdb_stdlog, "csky: continuing\n");
} }
continue; continue;
} }
@ -1406,8 +1406,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
anything. */ anything. */
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: no subu sp,r4; " gdb_printf (gdb_stdlog, "csky: no subu sp,r4; "
"NOT altering stacksize.\n"); "NOT altering stacksize.\n");
} }
break; break;
} }
@ -1416,8 +1416,8 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
/* This is not a prologue instruction, so stop here. */ /* This is not a prologue instruction, so stop here. */
if (csky_debug) if (csky_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "csky: insn is not a prologue" gdb_printf (gdb_stdlog, "csky: insn is not a prologue"
" insn -- ending scan\n"); " insn -- ending scan\n");
} }
break; break;
} }
@ -1455,12 +1455,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
{ {
CORE_ADDR rn_value = read_memory_unsigned_integer ( CORE_ADDR rn_value = read_memory_unsigned_integer (
this_cache->saved_regs[rn].addr (), 4, byte_order); this_cache->saved_regs[rn].addr (), 4, byte_order);
fprintf_unfiltered (gdb_stdlog, "Saved register %s " gdb_printf (gdb_stdlog, "Saved register %s "
"stored at 0x%08lx, value=0x%08lx\n", "stored at 0x%08lx, value=0x%08lx\n",
csky_register_names[rn], csky_register_names[rn],
(unsigned long) (unsigned long)
this_cache->saved_regs[rn].addr (), this_cache->saved_regs[rn].addr (),
(unsigned long) rn_value); (unsigned long) rn_value);
} }
} }
} }

View file

@ -1398,7 +1398,7 @@ ctf_psymtab::read_symtab (struct objfile *objfile)
{ {
if (info_verbose) if (info_verbose)
{ {
printf_filtered (_("Reading in CTF data for %s..."), filename); gdb_printf (_("Reading in CTF data for %s..."), filename);
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
} }
@ -1417,7 +1417,7 @@ ctf_psymtab::read_symtab (struct objfile *objfile)
/* Finish up the debug error message. */ /* Finish up the debug error message. */
if (info_verbose) if (info_verbose)
printf_filtered (_("done.\n")); gdb_printf (_("done.\n"));
} }
} }
@ -1601,7 +1601,7 @@ build_ctf_archive_member (ctf_dict_t *ctf, const char *name, void *arg)
if (info_verbose) if (info_verbose)
{ {
printf_filtered (_("Scanning archive member %s..."), name); gdb_printf (_("Scanning archive member %s..."), name);
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
} }

View file

@ -54,12 +54,12 @@
} while (0) } while (0)
#define PRINT_FIELD(structure, field) \ #define PRINT_FIELD(structure, field) \
printf_filtered(_(#field":\t%#lx\n"), (unsigned long) (structure)->field) gdb_printf(_(#field":\t%#lx\n"), (unsigned long) (structure)->field)
#define PRINT_TV_FIELD(structure, field) \ #define PRINT_TV_FIELD(structure, field) \
printf_filtered(_(#field":\t%u.%06u sec\n"), \ gdb_printf(_(#field":\t%u.%06u sec\n"), \
(unsigned) (structure)->field.seconds, \ (unsigned) (structure)->field.seconds, \
(unsigned) (structure)->field.microseconds) (unsigned) (structure)->field.microseconds)
#define task_self mach_task_self #define task_self mach_task_self
#define task_by_unix_pid task_for_pid #define task_by_unix_pid task_for_pid
@ -83,7 +83,7 @@ info_mach_tasks_command (const char *args, int from_tty)
sysctl (sysControl, 3, procInfo, &length, NULL, 0); sysctl (sysControl, 3, procInfo, &length, NULL, 0);
count = (length / sizeof (struct kinfo_proc)); count = (length / sizeof (struct kinfo_proc));
printf_filtered (_("%d processes:\n"), count); gdb_printf (_("%d processes:\n"), count);
for (index = 0; index < count; ++index) for (index = 0; index < count; ++index)
{ {
kern_return_t result; kern_return_t result;
@ -94,15 +94,15 @@ info_mach_tasks_command (const char *args, int from_tty)
&taskPort); &taskPort);
if (KERN_SUCCESS == result) if (KERN_SUCCESS == result)
{ {
printf_filtered (_(" %s is %d has task %#x\n"), gdb_printf (_(" %s is %d has task %#x\n"),
procInfo[index].kp_proc.p_comm, procInfo[index].kp_proc.p_comm,
procInfo[index].kp_proc.p_pid, taskPort); procInfo[index].kp_proc.p_pid, taskPort);
} }
else else
{ {
printf_filtered (_(" %s is %d unknown task port\n"), gdb_printf (_(" %s is %d unknown task port\n"),
procInfo[index].kp_proc.p_comm, procInfo[index].kp_proc.p_comm,
procInfo[index].kp_proc.p_pid); procInfo[index].kp_proc.p_pid);
} }
} }
@ -118,7 +118,7 @@ get_task_from_args (const char *args)
if (args == NULL || *args == 0) if (args == NULL || *args == 0)
{ {
if (inferior_ptid == null_ptid) if (inferior_ptid == null_ptid)
printf_filtered (_("No inferior running\n")); gdb_printf (_("No inferior running\n"));
darwin_inferior *priv = get_darwin_inferior (current_inferior ()); darwin_inferior *priv = get_darwin_inferior (current_inferior ());
@ -129,7 +129,7 @@ get_task_from_args (const char *args)
task = strtoul (args, &eptr, 0); task = strtoul (args, &eptr, 0);
if (*eptr) if (*eptr)
{ {
printf_filtered (_("cannot parse task id '%s'\n"), args); gdb_printf (_("cannot parse task id '%s'\n"), args);
return TASK_NULL; return TASK_NULL;
} }
return task; return task;
@ -153,7 +153,7 @@ info_mach_task_command (const char *args, int from_tty)
if (task == TASK_NULL) if (task == TASK_NULL)
return; return;
printf_filtered (_("TASK_BASIC_INFO for 0x%x:\n"), task); gdb_printf (_("TASK_BASIC_INFO for 0x%x:\n"), task);
info_count = TASK_BASIC_INFO_COUNT; info_count = TASK_BASIC_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_BASIC_INFO, TASK_BASIC_INFO,
@ -165,7 +165,7 @@ info_mach_task_command (const char *args, int from_tty)
PRINT_FIELD (&task_info_data.basic, resident_size); PRINT_FIELD (&task_info_data.basic, resident_size);
PRINT_TV_FIELD (&task_info_data.basic, user_time); PRINT_TV_FIELD (&task_info_data.basic, user_time);
PRINT_TV_FIELD (&task_info_data.basic, system_time); PRINT_TV_FIELD (&task_info_data.basic, system_time);
printf_filtered (_("\nTASK_EVENTS_INFO:\n")); gdb_printf (_("\nTASK_EVENTS_INFO:\n"));
info_count = TASK_EVENTS_INFO_COUNT; info_count = TASK_EVENTS_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_EVENTS_INFO, TASK_EVENTS_INFO,
@ -181,7 +181,7 @@ info_mach_task_command (const char *args, int from_tty)
PRINT_FIELD (&task_info_data.events, cow_faults); PRINT_FIELD (&task_info_data.events, cow_faults);
PRINT_FIELD (&task_info_data.events, messages_sent); PRINT_FIELD (&task_info_data.events, messages_sent);
PRINT_FIELD (&task_info_data.events, messages_received); PRINT_FIELD (&task_info_data.events, messages_received);
printf_filtered (_("\nTASK_THREAD_TIMES_INFO:\n")); gdb_printf (_("\nTASK_THREAD_TIMES_INFO:\n"));
info_count = TASK_THREAD_TIMES_INFO_COUNT; info_count = TASK_THREAD_TIMES_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_THREAD_TIMES_INFO, TASK_THREAD_TIMES_INFO,
@ -211,8 +211,8 @@ info_mach_ports_command (const char *args, int from_tty)
gdb_assert (name_count == type_count); gdb_assert (name_count == type_count);
printf_filtered (_("Ports for task 0x%x:\n"), task); gdb_printf (_("Ports for task 0x%x:\n"), task);
printf_filtered (_("port type\n")); gdb_printf (_("port type\n"));
for (index = 0; index < name_count; ++index) for (index = 0; index < name_count; ++index)
{ {
mach_port_t port = names[index]; mach_port_t port = names[index];
@ -232,47 +232,47 @@ info_mach_ports_command (const char *args, int from_tty)
{MACH_PORT_TYPE_DEAD_NAME, "dead", MACH_PORT_RIGHT_DEAD_NAME} {MACH_PORT_TYPE_DEAD_NAME, "dead", MACH_PORT_RIGHT_DEAD_NAME}
}; };
printf_filtered (_("%04x: %08x "), port, types[index]); gdb_printf (_("%04x: %08x "), port, types[index]);
for (j = 0; j < sizeof(descrs) / sizeof(*descrs); j++) for (j = 0; j < sizeof(descrs) / sizeof(*descrs); j++)
if (types[index] & descrs[j].type) if (types[index] & descrs[j].type)
{ {
mach_port_urefs_t ref; mach_port_urefs_t ref;
kern_return_t ret; kern_return_t ret;
printf_filtered (_(" %s("), descrs[j].name); gdb_printf (_(" %s("), descrs[j].name);
ret = mach_port_get_refs (task, port, descrs[j].right, &ref); ret = mach_port_get_refs (task, port, descrs[j].right, &ref);
if (ret != KERN_SUCCESS) if (ret != KERN_SUCCESS)
printf_filtered (_("??")); gdb_printf (_("??"));
else else
printf_filtered (_("%u"), ref); gdb_printf (_("%u"), ref);
printf_filtered (_(" refs)")); gdb_printf (_(" refs)"));
} }
if (task == task_self ()) if (task == task_self ())
{ {
if (port == task_self()) if (port == task_self())
printf_filtered (_(" gdb-task")); gdb_printf (_(" gdb-task"));
else if (port == darwin_host_self) else if (port == darwin_host_self)
printf_filtered (_(" host-self")); gdb_printf (_(" host-self"));
else if (port == darwin_ex_port) else if (port == darwin_ex_port)
printf_filtered (_(" gdb-exception")); gdb_printf (_(" gdb-exception"));
else if (port == darwin_port_set) else if (port == darwin_port_set)
printf_filtered (_(" gdb-port_set")); gdb_printf (_(" gdb-port_set"));
else if (inferior_ptid != null_ptid) else if (inferior_ptid != null_ptid)
{ {
struct inferior *inf = current_inferior (); struct inferior *inf = current_inferior ();
darwin_inferior *priv = get_darwin_inferior (inf); darwin_inferior *priv = get_darwin_inferior (inf);
if (port == priv->task) if (port == priv->task)
printf_filtered (_(" inferior-task")); gdb_printf (_(" inferior-task"));
else if (port == priv->notify_port) else if (port == priv->notify_port)
printf_filtered (_(" inferior-notify")); gdb_printf (_(" inferior-notify"));
else else
{ {
for (int k = 0; k < priv->exception_info.count; k++) for (int k = 0; k < priv->exception_info.count; k++)
if (port == priv->exception_info.ports[k]) if (port == priv->exception_info.ports[k])
{ {
printf_filtered (_(" inferior-excp-port")); gdb_printf (_(" inferior-excp-port"));
break; break;
} }
@ -280,8 +280,8 @@ info_mach_ports_command (const char *args, int from_tty)
{ {
if (port == t->gdb_port) if (port == t->gdb_port)
{ {
printf_filtered (_(" inferior-thread for 0x%x"), gdb_printf (_(" inferior-thread for 0x%x"),
priv->task); priv->task);
break; break;
} }
} }
@ -289,7 +289,7 @@ info_mach_ports_command (const char *args, int from_tty)
} }
} }
} }
printf_filtered (_("\n")); gdb_printf (_("\n"));
} }
vm_deallocate (task_self (), (vm_address_t) names, vm_deallocate (task_self (), (vm_address_t) names,
@ -310,18 +310,18 @@ darwin_debug_port_info (task_t task, mach_port_t port)
(task, port, MACH_PORT_RECEIVE_STATUS, (mach_port_info_t)&status, &len); (task, port, MACH_PORT_RECEIVE_STATUS, (mach_port_info_t)&status, &len);
MACH_CHECK_ERROR (kret); MACH_CHECK_ERROR (kret);
printf_filtered (_("Port 0x%lx in task 0x%lx:\n"), (unsigned long) port, gdb_printf (_("Port 0x%lx in task 0x%lx:\n"), (unsigned long) port,
(unsigned long) task); (unsigned long) task);
printf_filtered (_(" port set: 0x%x\n"), status.mps_pset); gdb_printf (_(" port set: 0x%x\n"), status.mps_pset);
printf_filtered (_(" seqno: 0x%x\n"), status.mps_seqno); gdb_printf (_(" seqno: 0x%x\n"), status.mps_seqno);
printf_filtered (_(" mscount: 0x%x\n"), status.mps_mscount); gdb_printf (_(" mscount: 0x%x\n"), status.mps_mscount);
printf_filtered (_(" qlimit: 0x%x\n"), status.mps_qlimit); gdb_printf (_(" qlimit: 0x%x\n"), status.mps_qlimit);
printf_filtered (_(" msgcount: 0x%x\n"), status.mps_msgcount); gdb_printf (_(" msgcount: 0x%x\n"), status.mps_msgcount);
printf_filtered (_(" sorights: 0x%x\n"), status.mps_sorights); gdb_printf (_(" sorights: 0x%x\n"), status.mps_sorights);
printf_filtered (_(" srights: 0x%x\n"), status.mps_srights); gdb_printf (_(" srights: 0x%x\n"), status.mps_srights);
printf_filtered (_(" pdrequest: 0x%x\n"), status.mps_pdrequest); gdb_printf (_(" pdrequest: 0x%x\n"), status.mps_pdrequest);
printf_filtered (_(" nsrequest: 0x%x\n"), status.mps_nsrequest); gdb_printf (_(" nsrequest: 0x%x\n"), status.mps_nsrequest);
printf_filtered (_(" flags: 0x%x\n"), status.mps_flags); gdb_printf (_(" flags: 0x%x\n"), status.mps_flags);
} }
static void static void
@ -352,10 +352,10 @@ info_mach_threads_command (const char *args, int from_tty)
result = task_threads (task, &threads, &thread_count); result = task_threads (task, &threads, &thread_count);
MACH_CHECK_ERROR (result); MACH_CHECK_ERROR (result);
printf_filtered (_("Threads in task %#x:\n"), task); gdb_printf (_("Threads in task %#x:\n"), task);
for (i = 0; i < thread_count; ++i) for (i = 0; i < thread_count; ++i)
{ {
printf_filtered (_(" %#x\n"), threads[i]); gdb_printf (_(" %#x\n"), threads[i]);
mach_port_deallocate (task_self (), threads[i]); mach_port_deallocate (task_self (), threads[i]);
} }
@ -378,7 +378,7 @@ info_mach_thread_command (const char *args, int from_tty)
CHECK_ARGS (_("Thread"), args); CHECK_ARGS (_("Thread"), args);
sscanf (args, "0x%x", &thread); sscanf (args, "0x%x", &thread);
printf_filtered (_("THREAD_BASIC_INFO\n")); gdb_printf (_("THREAD_BASIC_INFO\n"));
info_count = THREAD_BASIC_INFO_COUNT; info_count = THREAD_BASIC_INFO_COUNT;
result = thread_info (thread, result = thread_info (thread,
THREAD_BASIC_INFO, THREAD_BASIC_INFO,
@ -526,7 +526,7 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
(vm_region_info_t) &info, &count, &object_name); (vm_region_info_t) &info, &count, &object_name);
if (kret != KERN_SUCCESS) if (kret != KERN_SUCCESS)
{ {
printf_filtered (_("No memory regions.")); gdb_printf (_("No memory regions."));
return; return;
} }
memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t)); memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
@ -570,19 +570,19 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
if (print) if (print)
{ {
printf_filtered (_("%s-%s %s/%s %s %s %s"), gdb_printf (_("%s-%s %s/%s %s %s %s"),
paddress (target_gdbarch (), prev_address), paddress (target_gdbarch (), prev_address),
paddress (target_gdbarch (), prev_address + prev_size), paddress (target_gdbarch (), prev_address + prev_size),
unparse_protection (prev_info.protection), unparse_protection (prev_info.protection),
unparse_protection (prev_info.max_protection), unparse_protection (prev_info.max_protection),
unparse_inheritance (prev_info.inheritance), unparse_inheritance (prev_info.inheritance),
prev_info.shared ? _("shrd") : _("priv"), prev_info.shared ? _("shrd") : _("priv"),
prev_info.reserved ? _("reserved") : _("not-rsvd")); prev_info.reserved ? _("reserved") : _("not-rsvd"));
if (nsubregions > 1) if (nsubregions > 1)
printf_filtered (_(" (%d sub-rgn)"), nsubregions); gdb_printf (_(" (%d sub-rgn)"), nsubregions);
printf_filtered (_("\n")); gdb_printf (_("\n"));
prev_address = address; prev_address = address;
prev_size = size; prev_size = size;
@ -743,48 +743,48 @@ disp_exception (const darwin_exception_info *info)
{ {
int i; int i;
printf_filtered (_("%d exceptions:\n"), info->count); gdb_printf (_("%d exceptions:\n"), info->count);
for (i = 0; i < info->count; i++) for (i = 0; i < info->count; i++)
{ {
exception_mask_t mask = info->masks[i]; exception_mask_t mask = info->masks[i];
printf_filtered (_("port 0x%04x, behavior: "), info->ports[i]); gdb_printf (_("port 0x%04x, behavior: "), info->ports[i]);
switch (info->behaviors[i]) switch (info->behaviors[i])
{ {
case EXCEPTION_DEFAULT: case EXCEPTION_DEFAULT:
printf_filtered (_("default")); gdb_printf (_("default"));
break; break;
case EXCEPTION_STATE: case EXCEPTION_STATE:
printf_filtered (_("state")); gdb_printf (_("state"));
break; break;
case EXCEPTION_STATE_IDENTITY: case EXCEPTION_STATE_IDENTITY:
printf_filtered (_("state-identity")); gdb_printf (_("state-identity"));
break; break;
default: default:
printf_filtered (_("0x%x"), info->behaviors[i]); gdb_printf (_("0x%x"), info->behaviors[i]);
} }
printf_filtered (_(", masks:")); gdb_printf (_(", masks:"));
if (mask & EXC_MASK_BAD_ACCESS) if (mask & EXC_MASK_BAD_ACCESS)
printf_filtered (_(" BAD_ACCESS")); gdb_printf (_(" BAD_ACCESS"));
if (mask & EXC_MASK_BAD_INSTRUCTION) if (mask & EXC_MASK_BAD_INSTRUCTION)
printf_filtered (_(" BAD_INSTRUCTION")); gdb_printf (_(" BAD_INSTRUCTION"));
if (mask & EXC_MASK_ARITHMETIC) if (mask & EXC_MASK_ARITHMETIC)
printf_filtered (_(" ARITHMETIC")); gdb_printf (_(" ARITHMETIC"));
if (mask & EXC_MASK_EMULATION) if (mask & EXC_MASK_EMULATION)
printf_filtered (_(" EMULATION")); gdb_printf (_(" EMULATION"));
if (mask & EXC_MASK_SOFTWARE) if (mask & EXC_MASK_SOFTWARE)
printf_filtered (_(" SOFTWARE")); gdb_printf (_(" SOFTWARE"));
if (mask & EXC_MASK_BREAKPOINT) if (mask & EXC_MASK_BREAKPOINT)
printf_filtered (_(" BREAKPOINT")); gdb_printf (_(" BREAKPOINT"));
if (mask & EXC_MASK_SYSCALL) if (mask & EXC_MASK_SYSCALL)
printf_filtered (_(" SYSCALL")); gdb_printf (_(" SYSCALL"));
if (mask & EXC_MASK_MACH_SYSCALL) if (mask & EXC_MASK_MACH_SYSCALL)
printf_filtered (_(" MACH_SYSCALL")); gdb_printf (_(" MACH_SYSCALL"));
if (mask & EXC_MASK_RPC_ALERT) if (mask & EXC_MASK_RPC_ALERT)
printf_filtered (_(" RPC_ALERT")); gdb_printf (_(" RPC_ALERT"));
if (mask & EXC_MASK_CRASH) if (mask & EXC_MASK_CRASH)
printf_filtered (_(" CRASH")); gdb_printf (_(" CRASH"));
printf_filtered (_("\n")); gdb_printf (_("\n"));
} }
} }
@ -801,7 +801,7 @@ info_mach_exceptions_command (const char *args, int from_tty)
if (strcmp (args, "saved") == 0) if (strcmp (args, "saved") == 0)
{ {
if (inferior_ptid == null_ptid) if (inferior_ptid == null_ptid)
printf_filtered (_("No inferior running\n")); gdb_printf (_("No inferior running\n"));
darwin_inferior *priv = get_darwin_inferior (current_inferior ()); darwin_inferior *priv = get_darwin_inferior (current_inferior ());
@ -825,7 +825,7 @@ info_mach_exceptions_command (const char *args, int from_tty)
struct inferior *inf; struct inferior *inf;
if (inferior_ptid == null_ptid) if (inferior_ptid == null_ptid)
printf_filtered (_("No inferior running\n")); gdb_printf (_("No inferior running\n"));
inf = current_inferior (); inf = current_inferior ();
darwin_inferior *priv = get_darwin_inferior (inf); darwin_inferior *priv = get_darwin_inferior (inf);

View file

@ -169,7 +169,7 @@ inferior_debug (int level, const char *fmt, ...)
return; return;
va_start (ap, fmt); va_start (ap, fmt);
fprintf_unfiltered (gdb_stdlog, _("[%d inferior]: "), getpid ()); gdb_printf (gdb_stdlog, _("[%d inferior]: "), getpid ());
vfprintf_unfiltered (gdb_stdlog, fmt, ap); vfprintf_unfiltered (gdb_stdlog, fmt, ap);
va_end (ap); va_end (ap);
} }
@ -459,20 +459,20 @@ darwin_resume_inferior (struct inferior *inf)
static void static void
darwin_dump_message (mach_msg_header_t *hdr, int disp_body) darwin_dump_message (mach_msg_header_t *hdr, int disp_body)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_("message header:\n")); _("message header:\n"));
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" bits: 0x%x\n"), hdr->msgh_bits); _(" bits: 0x%x\n"), hdr->msgh_bits);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" size: 0x%x\n"), hdr->msgh_size); _(" size: 0x%x\n"), hdr->msgh_size);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" remote-port: 0x%x\n"), hdr->msgh_remote_port); _(" remote-port: 0x%x\n"), hdr->msgh_remote_port);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" local-port: 0x%x\n"), hdr->msgh_local_port); _(" local-port: 0x%x\n"), hdr->msgh_local_port);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" reserved: 0x%x\n"), hdr->msgh_reserved); _(" reserved: 0x%x\n"), hdr->msgh_reserved);
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" id: 0x%x\n"), hdr->msgh_id); _(" id: 0x%x\n"), hdr->msgh_id);
if (disp_body) if (disp_body)
{ {
@ -491,24 +491,24 @@ darwin_dump_message (mach_msg_header_t *hdr, int disp_body)
(mach_msg_port_descriptor_t *)(bod + 1); (mach_msg_port_descriptor_t *)(bod + 1);
int k; int k;
NDR_record_t *ndr; NDR_record_t *ndr;
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_("body: descriptor_count=%u\n"), _("body: descriptor_count=%u\n"),
bod->msgh_descriptor_count); bod->msgh_descriptor_count);
data += sizeof (mach_msg_body_t); data += sizeof (mach_msg_body_t);
size -= sizeof (mach_msg_body_t); size -= sizeof (mach_msg_body_t);
for (k = 0; k < bod->msgh_descriptor_count; k++) for (k = 0; k < bod->msgh_descriptor_count; k++)
switch (desc[k].type) switch (desc[k].type)
{ {
case MACH_MSG_PORT_DESCRIPTOR: case MACH_MSG_PORT_DESCRIPTOR:
fprintf_unfiltered gdb_printf
(gdb_stdlog, (gdb_stdlog,
_(" descr %d: type=%u (port) name=0x%x, dispo=%d\n"), _(" descr %d: type=%u (port) name=0x%x, dispo=%d\n"),
k, desc[k].type, desc[k].name, desc[k].disposition); k, desc[k].type, desc[k].name, desc[k].disposition);
break; break;
default: default:
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
_(" descr %d: type=%u\n"), _(" descr %d: type=%u\n"),
k, desc[k].type); k, desc[k].type);
break; break;
} }
data += bod->msgh_descriptor_count data += bod->msgh_descriptor_count
@ -516,7 +516,7 @@ darwin_dump_message (mach_msg_header_t *hdr, int disp_body)
size -= bod->msgh_descriptor_count size -= bod->msgh_descriptor_count
* sizeof (mach_msg_port_descriptor_t); * sizeof (mach_msg_port_descriptor_t);
ndr = (NDR_record_t *)(desc + bod->msgh_descriptor_count); ndr = (NDR_record_t *)(desc + bod->msgh_descriptor_count);
fprintf_unfiltered gdb_printf
(gdb_stdlog, (gdb_stdlog,
_("NDR: mig=%02x if=%02x encod=%02x " _("NDR: mig=%02x if=%02x encod=%02x "
"int=%02x char=%02x float=%02x\n"), "int=%02x char=%02x float=%02x\n"),
@ -526,11 +526,11 @@ darwin_dump_message (mach_msg_header_t *hdr, int disp_body)
size -= sizeof (NDR_record_t); size -= sizeof (NDR_record_t);
} }
fprintf_unfiltered (gdb_stdlog, _(" data:")); gdb_printf (gdb_stdlog, _(" data:"));
ldata = (const unsigned int *)data; ldata = (const unsigned int *)data;
for (i = 0; i < size / sizeof (unsigned int); i++) for (i = 0; i < size / sizeof (unsigned int); i++)
fprintf_unfiltered (gdb_stdlog, " %08x", ldata[i]); gdb_printf (gdb_stdlog, " %08x", ldata[i]);
fprintf_unfiltered (gdb_stdlog, _("\n")); gdb_printf (gdb_stdlog, _("\n"));
} }
} }
@ -1793,7 +1793,7 @@ darwin_execvp (const char *file, char * const argv[], char * const env[])
res = posix_spawnattr_init (&attr); res = posix_spawnattr_init (&attr);
if (res != 0) if (res != 0)
{ {
fprintf_unfiltered gdb_printf
(gdb_stderr, "Cannot initialize attribute for posix_spawn\n"); (gdb_stderr, "Cannot initialize attribute for posix_spawn\n");
return; return;
} }
@ -1810,7 +1810,7 @@ darwin_execvp (const char *file, char * const argv[], char * const env[])
res = posix_spawnattr_setflags (&attr, ps_flags); res = posix_spawnattr_setflags (&attr, ps_flags);
if (res != 0) if (res != 0)
{ {
fprintf_unfiltered (gdb_stderr, "Cannot set posix_spawn flags\n"); gdb_printf (gdb_stderr, "Cannot set posix_spawn flags\n");
return; return;
} }
@ -1945,11 +1945,11 @@ you \"run\". To prevent these attempts, you can use:\n\
return false; return false;
} }
printf_filtered (_("Note: this version of macOS has System Integrity Protection.\n\ gdb_printf (_("Note: this version of macOS has System Integrity Protection.\n\
Because `startup-with-shell' is enabled, gdb has worked around this by\n\ Because `startup-with-shell' is enabled, gdb has worked around this by\n\
caching a copy of your shell. The shell used by \"run\" is now:\n\ caching a copy of your shell. The shell used by \"run\" is now:\n\
%s\n"), %s\n"),
new_name.c_str ()); new_name.c_str ());
} }
/* We need to make sure that the new name has the correct lifetime. */ /* We need to make sure that the new name has the correct lifetime. */

View file

@ -1836,12 +1836,12 @@ read_dbx_symtab (minimal_symbol_reader &reader,
(dependencies_used (dependencies_used
* sizeof (legacy_psymtab *))); * sizeof (legacy_psymtab *)));
#ifdef DEBUG_INFO #ifdef DEBUG_INFO
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
"Had to reallocate " "Had to reallocate "
"dependency list.\n"); "dependency list.\n");
fprintf_unfiltered (gdb_stderr, gdb_printf (gdb_stderr,
"New dependencies allocated: %d\n", "New dependencies allocated: %d\n",
dependencies_allocated); dependencies_allocated);
#endif #endif
} }
} }

View file

@ -136,7 +136,7 @@ static void
show_dcache_enabled_p (struct ui_file *file, int from_tty, show_dcache_enabled_p (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Deprecated remotecache flag is %s.\n"), value); gdb_printf (file, _("Deprecated remotecache flag is %s.\n"), value);
} }
/* Add BLOCK to circular block list BLIST, behind the block at *BLIST. /* Add BLOCK to circular block list BLIST, behind the block at *BLIST.
@ -554,7 +554,7 @@ dcache_print_line (DCACHE *dcache, int index)
if (dcache == NULL) if (dcache == NULL)
{ {
printf_filtered (_("No data cache available.\n")); gdb_printf (_("No data cache available.\n"));
return; return;
} }
@ -569,24 +569,24 @@ dcache_print_line (DCACHE *dcache, int index)
if (!n) if (!n)
{ {
printf_filtered (_("No such cache line exists.\n")); gdb_printf (_("No such cache line exists.\n"));
return; return;
} }
db = (struct dcache_block *) n->value; db = (struct dcache_block *) n->value;
printf_filtered (_("Line %d: address %s [%d hits]\n"), gdb_printf (_("Line %d: address %s [%d hits]\n"),
index, paddress (target_gdbarch (), db->addr), db->refs); index, paddress (target_gdbarch (), db->addr), db->refs);
for (j = 0; j < dcache->line_size; j++) for (j = 0; j < dcache->line_size; j++)
{ {
printf_filtered ("%02x ", db->data[j]); gdb_printf ("%02x ", db->data[j]);
/* Print a newline every 16 bytes (48 characters). */ /* Print a newline every 16 bytes (48 characters). */
if ((j % 16 == 15) && (j != dcache->line_size - 1)) if ((j % 16 == 15) && (j != dcache->line_size - 1))
printf_filtered ("\n"); gdb_printf ("\n");
} }
printf_filtered ("\n"); gdb_printf ("\n");
} }
/* Parse EXP and show the info about DCACHE. */ /* Parse EXP and show the info about DCACHE. */
@ -604,7 +604,7 @@ dcache_info_1 (DCACHE *dcache, const char *exp)
i = strtol (exp, &linestart, 10); i = strtol (exp, &linestart, 10);
if (linestart == exp || i < 0) if (linestart == exp || i < 0)
{ {
printf_filtered (_("Usage: info dcache [LINENUMBER]\n")); gdb_printf (_("Usage: info dcache [LINENUMBER]\n"));
return; return;
} }
@ -612,19 +612,19 @@ dcache_info_1 (DCACHE *dcache, const char *exp)
return; return;
} }
printf_filtered (_("Dcache %u lines of %u bytes each.\n"), gdb_printf (_("Dcache %u lines of %u bytes each.\n"),
dcache_size, dcache_size,
dcache ? (unsigned) dcache->line_size dcache ? (unsigned) dcache->line_size
: dcache_line_size); : dcache_line_size);
if (dcache == NULL || dcache->ptid == null_ptid) if (dcache == NULL || dcache->ptid == null_ptid)
{ {
printf_filtered (_("No data cache available.\n")); gdb_printf (_("No data cache available.\n"));
return; return;
} }
printf_filtered (_("Contains data for %s\n"), gdb_printf (_("Contains data for %s\n"),
target_pid_to_str (dcache->ptid).c_str ()); target_pid_to_str (dcache->ptid).c_str ());
refcount = 0; refcount = 0;
@ -635,15 +635,15 @@ dcache_info_1 (DCACHE *dcache, const char *exp)
{ {
struct dcache_block *db = (struct dcache_block *) n->value; struct dcache_block *db = (struct dcache_block *) n->value;
printf_filtered (_("Line %d: address %s [%d hits]\n"), gdb_printf (_("Line %d: address %s [%d hits]\n"),
i, paddress (target_gdbarch (), db->addr), db->refs); i, paddress (target_gdbarch (), db->addr), db->refs);
i++; i++;
refcount += db->refs; refcount += db->refs;
n = splay_tree_successor (dcache->tree, n->key); n = splay_tree_successor (dcache->tree, n->key);
} }
printf_filtered (_("Cache state: %d active lines, %d hits\n"), i, refcount); gdb_printf (_("Cache state: %d active lines, %d hits\n"), i, refcount);
} }
static void static void

View file

@ -115,9 +115,9 @@ progressfn (debuginfod_client *c, long cur, long total)
if (check_quit_flag ()) if (check_quit_flag ())
{ {
printf_filtered ("Cancelling download of %s %ps...\n", gdb_printf ("Cancelling download of %s %ps...\n",
data->desc, data->desc,
styled_string (file_name_style.style (), data->fname)); styled_string (file_name_style.style (), data->fname));
return 1; return 1;
} }
@ -136,14 +136,14 @@ progressfn (debuginfod_client *c, long cur, long total)
unit = "MB"; unit = "MB";
} }
printf_filtered ("Downloading %.2f %s %s %ps...\n", gdb_printf ("Downloading %.2f %s %s %ps...\n",
size, unit, data->desc, size, unit, data->desc,
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
data->fname)); data->fname));
} }
else else
printf_filtered ("Downloading %s %ps...\n", data->desc, gdb_printf ("Downloading %s %ps...\n", data->desc,
styled_string (file_name_style.style (), data->fname)); styled_string (file_name_style.style (), data->fname));
data->has_printed = true; data->has_printed = true;
} }
@ -187,16 +187,16 @@ debuginfod_is_enabled ()
urls); urls);
if (!resp) if (!resp)
{ {
printf_filtered (_("Debuginfod has been disabled.\nTo make this " \ gdb_printf (_("Debuginfod has been disabled.\nTo make this " \
"setting permanent, add \'set debuginfod " \ "setting permanent, add \'set debuginfod " \
"enabled off\' to .gdbinit.\n")); "enabled off\' to .gdbinit.\n"));
debuginfod_enabled = debuginfod_off; debuginfod_enabled = debuginfod_off;
return false; return false;
} }
printf_filtered (_("Debuginfod has been enabled.\nTo make this " \ gdb_printf (_("Debuginfod has been enabled.\nTo make this " \
"setting permanent, add \'set debuginfod enabled " \ "setting permanent, add \'set debuginfod enabled " \
"on\' to .gdbinit.\n")); "on\' to .gdbinit.\n"));
debuginfod_enabled = debuginfod_on; debuginfod_enabled = debuginfod_on;
} }
@ -238,9 +238,9 @@ debuginfod_source_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr); debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT) if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"), gdb_printf (_("Download failed: %s. Continuing without source file %ps.\n"),
safe_strerror (-fd.get ()), safe_strerror (-fd.get ()),
styled_string (file_name_style.style (), srcpath)); styled_string (file_name_style.style (), srcpath));
if (fd.get () >= 0) if (fd.get () >= 0)
destname->reset (dname); destname->reset (dname);
@ -280,9 +280,9 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr); debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT) if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
printf_filtered (_("Download failed: %s. Continuing without debug info for %ps.\n"), gdb_printf (_("Download failed: %s. Continuing without debug info for %ps.\n"),
safe_strerror (-fd.get ()), safe_strerror (-fd.get ()),
styled_string (file_name_style.style (), filename)); styled_string (file_name_style.style (), filename));
if (fd.get () >= 0) if (fd.get () >= 0)
destname->reset (dname); destname->reset (dname);
@ -321,10 +321,10 @@ debuginfod_exec_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr); debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT) if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
printf_filtered (_("Download failed: %s. " \ gdb_printf (_("Download failed: %s. " \
"Continuing without executable for %ps.\n"), "Continuing without executable for %ps.\n"),
safe_strerror (-fd.get ()), safe_strerror (-fd.get ()),
styled_string (file_name_style.style (), filename)); styled_string (file_name_style.style (), filename));
if (fd.get () >= 0) if (fd.get () >= 0)
destname->reset (dname); destname->reset (dname);
@ -359,9 +359,9 @@ static void
show_debuginfod_enabled (ui_file *file, int from_tty, cmd_list_element *cmd, show_debuginfod_enabled (ui_file *file, int from_tty, cmd_list_element *cmd,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Debuginfod functionality is currently set to " _("Debuginfod functionality is currently set to "
"\"%s\".\n"), debuginfod_enabled); "\"%s\".\n"), debuginfod_enabled);
} }
/* Set callback for "set debuginfod urls". */ /* Set callback for "set debuginfod urls". */
@ -402,10 +402,10 @@ show_debuginfod_urls (ui_file *file, int from_tty, cmd_list_element *cmd,
const char *value) const char *value)
{ {
if (value[0] == '\0') if (value[0] == '\0')
fprintf_filtered (file, _("Debuginfod URLs have not been set.\n")); gdb_printf (file, _("Debuginfod URLs have not been set.\n"));
else else
fprintf_filtered (file, _("Debuginfod URLs are currently set to:\n%s\n"), gdb_printf (file, _("Debuginfod URLs are currently set to:\n%s\n"),
value); value);
} }
/* Show callback for "set debuginfod verbose". */ /* Show callback for "set debuginfod verbose". */
@ -414,8 +414,8 @@ static void
show_debuginfod_verbose_command (ui_file *file, int from_tty, show_debuginfod_verbose_command (ui_file *file, int from_tty,
cmd_list_element *cmd, const char *value) cmd_list_element *cmd, const char *value)
{ {
fprintf_filtered (file, _("Debuginfod verbose output is set to %s.\n"), gdb_printf (file, _("Debuginfod verbose output is set to %s.\n"),
value); value);
} }
/* Register debuginfod commands. */ /* Register debuginfod commands. */

View file

@ -135,14 +135,14 @@ print_one_insn_test (struct gdbarch *gdbarch)
{ {
if (run_verbose ()) if (run_verbose ())
{ {
fprintf_unfiltered (stream (), "%s ", gdb_printf (stream (), "%s ",
gdbarch_bfd_arch_info (arch ())->arch_name); gdbarch_bfd_arch_info (arch ())->arch_name);
} }
int len = gdb_disassembler::print_insn (memaddr); int len = gdb_disassembler::print_insn (memaddr);
if (run_verbose ()) if (run_verbose ())
fprintf_unfiltered (stream (), "\n"); gdb_printf (stream (), "\n");
return len; return len;
} }

View file

@ -1048,7 +1048,7 @@ set_disassembler_options (const char *prospective_options)
valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch); valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch);
if (valid_options_and_args == NULL) if (valid_options_and_args == NULL)
{ {
fprintf_filtered (gdb_stderr, _("\ gdb_printf (gdb_stderr, _("\
'set disassembler-options ...' is not supported on this architecture.\n")); 'set disassembler-options ...' is not supported on this architecture.\n"));
return; return;
} }
@ -1084,9 +1084,9 @@ set_disassembler_options (const char *prospective_options)
break; break;
if (valid_options->name[i] == NULL) if (valid_options->name[i] == NULL)
{ {
fprintf_filtered (gdb_stderr, gdb_printf (gdb_stderr,
_("Invalid disassembler option value: '%s'.\n"), _("Invalid disassembler option value: '%s'.\n"),
opt); opt);
return; return;
} }
} }
@ -1115,8 +1115,8 @@ show_disassembler_options_sfunc (struct ui_file *file, int from_tty,
if (options == NULL) if (options == NULL)
options = ""; options = "";
fprintf_filtered (file, _("The current disassembler options are '%s'\n\n"), gdb_printf (file, _("The current disassembler options are '%s'\n\n"),
options); options);
valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch); valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch);
@ -1130,7 +1130,7 @@ show_disassembler_options_sfunc (struct ui_file *file, int from_tty,
valid_options = &valid_options_and_args->options; valid_options = &valid_options_and_args->options;
fprintf_filtered (file, _("\ gdb_printf (file, _("\
The following disassembler options are supported for use with the\n\ The following disassembler options are supported for use with the\n\
'set disassembler-options OPTION [,OPTION]...' command:\n")); 'set disassembler-options OPTION [,OPTION]...' command:\n"));
@ -1138,7 +1138,7 @@ The following disassembler options are supported for use with the\n\
{ {
size_t i, max_len = 0; size_t i, max_len = 0;
fprintf_filtered (file, "\n"); gdb_printf (file, "\n");
/* Compute the length of the longest option name. */ /* Compute the length of the longest option name. */
for (i = 0; valid_options->name[i] != NULL; i++) for (i = 0; valid_options->name[i] != NULL; i++)
@ -1153,35 +1153,35 @@ The following disassembler options are supported for use with the\n\
for (i = 0, max_len++; valid_options->name[i] != NULL; i++) for (i = 0, max_len++; valid_options->name[i] != NULL; i++)
{ {
fprintf_filtered (file, " %s", valid_options->name[i]); gdb_printf (file, " %s", valid_options->name[i]);
if (valid_options->arg != NULL && valid_options->arg[i] != NULL) if (valid_options->arg != NULL && valid_options->arg[i] != NULL)
fprintf_filtered (file, "%s", valid_options->arg[i]->name); gdb_printf (file, "%s", valid_options->arg[i]->name);
if (valid_options->description[i] != NULL) if (valid_options->description[i] != NULL)
{ {
size_t len = strlen (valid_options->name[i]); size_t len = strlen (valid_options->name[i]);
if (valid_options->arg != NULL && valid_options->arg[i] != NULL) if (valid_options->arg != NULL && valid_options->arg[i] != NULL)
len += strlen (valid_options->arg[i]->name); len += strlen (valid_options->arg[i]->name);
fprintf_filtered (file, "%*c %s", (int) (max_len - len), ' ', gdb_printf (file, "%*c %s", (int) (max_len - len), ' ',
valid_options->description[i]); valid_options->description[i]);
} }
fprintf_filtered (file, "\n"); gdb_printf (file, "\n");
} }
} }
else else
{ {
size_t i; size_t i;
fprintf_filtered (file, " "); gdb_printf (file, " ");
for (i = 0; valid_options->name[i] != NULL; i++) for (i = 0; valid_options->name[i] != NULL; i++)
{ {
fprintf_filtered (file, "%s", valid_options->name[i]); gdb_printf (file, "%s", valid_options->name[i]);
if (valid_options->arg != NULL && valid_options->arg[i] != NULL) if (valid_options->arg != NULL && valid_options->arg[i] != NULL)
fprintf_filtered (file, "%s", valid_options->arg[i]->name); gdb_printf (file, "%s", valid_options->arg[i]->name);
if (valid_options->name[i + 1] != NULL) if (valid_options->name[i + 1] != NULL)
fprintf_filtered (file, ", "); gdb_printf (file, ", ");
file->wrap_here (2); file->wrap_here (2);
} }
fprintf_filtered (file, "\n"); gdb_printf (file, "\n");
} }
valid_args = valid_options_and_args->args; valid_args = valid_options_and_args->args;
@ -1191,15 +1191,15 @@ The following disassembler options are supported for use with the\n\
for (i = 0; valid_args[i].name != NULL; i++) for (i = 0; valid_args[i].name != NULL; i++)
{ {
fprintf_filtered (file, _("\n\ gdb_printf (file, _("\n\
For the options above, the following values are supported for \"%s\":\n "), For the options above, the following values are supported for \"%s\":\n "),
valid_args[i].name); valid_args[i].name);
for (j = 0; valid_args[i].values[j] != NULL; j++) for (j = 0; valid_args[i].values[j] != NULL; j++)
{ {
fprintf_filtered (file, " %s", valid_args[i].values[j]); gdb_printf (file, " %s", valid_args[i].values[j]);
file->wrap_here (3); file->wrap_here (3);
} }
fprintf_filtered (file, "\n"); gdb_printf (file, "\n");
} }
} }
} }

View file

@ -40,7 +40,7 @@ static void
show_debug_displaced (struct ui_file *file, int from_tty, show_debug_displaced (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Displace stepping debugging is %s.\n"), value); gdb_printf (file, _("Displace stepping debugging is %s.\n"), value);
} }
displaced_step_prepare_status displaced_step_prepare_status

View file

@ -405,10 +405,10 @@ fprint_dummy_frames (struct ui_file *file)
struct dummy_frame *s; struct dummy_frame *s;
for (s = dummy_frame_stack; s != NULL; s = s->next) for (s = dummy_frame_stack; s != NULL; s = s->next)
fprintf_filtered (file, "%s: id=%s, ptid=%s\n", gdb_printf (file, "%s: id=%s, ptid=%s\n",
host_address_to_string (s), host_address_to_string (s),
s->id.id.to_string ().c_str (), s->id.id.to_string ().c_str (),
s->id.thread->ptid.to_string ().c_str ()); s->id.thread->ptid.to_string ().c_str ());
} }
static void static void

View file

@ -2192,9 +2192,9 @@ show_dwarf_unwinders_enabled_p (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("The DWARF stack unwinders are currently %s.\n"), _("The DWARF stack unwinders are currently %s.\n"),
value); value);
} }
void _initialize_dwarf2_frame (); void _initialize_dwarf2_frame ();

View file

@ -257,8 +257,8 @@ show_index_cache_command (const char *arg, int from_tty)
/* Call all "show index-cache" subcommands. */ /* Call all "show index-cache" subcommands. */
cmd_show_list (show_index_cache_prefix_list, from_tty); cmd_show_list (show_index_cache_prefix_list, from_tty);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered gdb_printf
(_("The index cache is currently %s.\n"), (_("The index cache is currently %s.\n"),
global_index_cache.enabled () ? _("enabled") : _("disabled")); global_index_cache.enabled () ? _("enabled") : _("disabled"));
} }
@ -288,7 +288,7 @@ static void
show_index_cache_enabled_command (ui_file *stream, int from_tty, show_index_cache_enabled_command (ui_file *stream, int from_tty,
cmd_list_element *cmd, const char *value) cmd_list_element *cmd, const char *value)
{ {
fprintf_filtered (stream, _("The index cache is %s.\n"), value); gdb_printf (stream, _("The index cache is %s.\n"), value);
} }
/* "set index-cache directory" handler. */ /* "set index-cache directory" handler. */
@ -316,13 +316,13 @@ show_index_cache_stats_command (const char *arg, int from_tty)
if (in_show_index_cache_command) if (in_show_index_cache_command)
{ {
indent = " "; indent = " ";
printf_filtered ("\n"); gdb_printf ("\n");
} }
printf_filtered (_("%s Cache hits (this session): %u\n"), gdb_printf (_("%s Cache hits (this session): %u\n"),
indent, global_index_cache.n_hits ()); indent, global_index_cache.n_hits ());
printf_filtered (_("%sCache misses (this session): %u\n"), gdb_printf (_("%sCache misses (this session): %u\n"),
indent, global_index_cache.n_misses ()); indent, global_index_cache.n_misses ());
} }
void _initialize_index_cache (); void _initialize_index_cache ();

View file

@ -35,8 +35,8 @@ line_header::add_include_dir (const char *include_dir)
new_size = m_include_dirs.size (); new_size = m_include_dirs.size ();
else else
new_size = m_include_dirs.size () + 1; new_size = m_include_dirs.size () + 1;
fprintf_unfiltered (gdb_stdlog, "Adding dir %zu: %s\n", gdb_printf (gdb_stdlog, "Adding dir %zu: %s\n",
new_size, include_dir); new_size, include_dir);
} }
m_include_dirs.push_back (include_dir); m_include_dirs.push_back (include_dir);
} }
@ -54,8 +54,8 @@ line_header::add_file_name (const char *name,
new_size = file_names_size (); new_size = file_names_size ();
else else
new_size = file_names_size () + 1; new_size = file_names_size () + 1;
fprintf_unfiltered (gdb_stdlog, "Adding file %zu: %s\n", gdb_printf (gdb_stdlog, "Adding file %zu: %s\n",
new_size, name); new_size, name);
} }
m_file_names.emplace_back (name, d_index, mod_time, length); m_file_names.emplace_back (name, d_index, mod_time, length);
} }

View file

@ -627,9 +627,9 @@ static void
show_entry_values_debug (struct ui_file *file, int from_tty, show_entry_values_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Entry values and tail call frames debugging is %s.\n"), _("Entry values and tail call frames debugging is %s.\n"),
value); value);
} }
/* See gdbtypes.h. */ /* See gdbtypes.h. */
@ -836,9 +836,9 @@ tailcall_dump (struct gdbarch *gdbarch, const struct call_site *call_site)
CORE_ADDR addr = call_site->pc (); CORE_ADDR addr = call_site->pc ();
struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (addr - 1); struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (addr - 1);
fprintf_unfiltered (gdb_stdlog, " %s(%s)", paddress (gdbarch, addr), gdb_printf (gdb_stdlog, " %s(%s)", paddress (gdbarch, addr),
(msym.minsym == NULL ? "???" (msym.minsym == NULL ? "???"
: msym.minsym->print_name ())); : msym.minsym->print_name ()));
} }
@ -874,7 +874,7 @@ chain_candidate (struct gdbarch *gdbarch,
if (entry_values_debug) if (entry_values_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "tailcall: initial:"); gdb_printf (gdb_stdlog, "tailcall: initial:");
for (idx = 0; idx < length; idx++) for (idx = 0; idx < length; idx++)
tailcall_dump (gdbarch, result->call_site[idx]); tailcall_dump (gdbarch, result->call_site[idx]);
gdb_putc ('\n', gdb_stdlog); gdb_putc ('\n', gdb_stdlog);
@ -885,7 +885,7 @@ chain_candidate (struct gdbarch *gdbarch,
if (entry_values_debug) if (entry_values_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "tailcall: compare:"); gdb_printf (gdb_stdlog, "tailcall: compare:");
for (idx = 0; idx < length; idx++) for (idx = 0; idx < length; idx++)
tailcall_dump (gdbarch, chain[idx]); tailcall_dump (gdbarch, chain[idx]);
gdb_putc ('\n', gdb_stdlog); gdb_putc ('\n', gdb_stdlog);
@ -914,7 +914,7 @@ chain_candidate (struct gdbarch *gdbarch,
if (entry_values_debug) if (entry_values_debug)
{ {
fprintf_unfiltered (gdb_stdlog, "tailcall: reduced:"); gdb_printf (gdb_stdlog, "tailcall: reduced:");
for (idx = 0; idx < (*resultp)->callers; idx++) for (idx = 0; idx < (*resultp)->callers; idx++)
tailcall_dump (gdbarch, (*resultp)->call_site[idx]); tailcall_dump (gdbarch, (*resultp)->call_site[idx]);
gdb_puts (" |", gdb_stdlog); gdb_puts (" |", gdb_stdlog);
@ -3144,8 +3144,8 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
if (data[0] >= DW_OP_reg0 && data[0] <= DW_OP_reg31) if (data[0] >= DW_OP_reg0 && data[0] <= DW_OP_reg31)
{ {
fprintf_filtered (stream, _("a variable in $%s"), gdb_printf (stream, _("a variable in $%s"),
locexpr_regname (gdbarch, data[0] - DW_OP_reg0)); locexpr_regname (gdbarch, data[0] - DW_OP_reg0));
data += 1; data += 1;
} }
else if (data[0] == DW_OP_regx) else if (data[0] == DW_OP_regx)
@ -3153,8 +3153,8 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
uint64_t reg; uint64_t reg;
data = safe_read_uleb128 (data + 1, end, &reg); data = safe_read_uleb128 (data + 1, end, &reg);
fprintf_filtered (stream, _("a variable in $%s"), gdb_printf (stream, _("a variable in $%s"),
locexpr_regname (gdbarch, reg)); locexpr_regname (gdbarch, reg));
} }
else if (data[0] == DW_OP_fbreg) else if (data[0] == DW_OP_fbreg)
{ {
@ -3210,10 +3210,10 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
return save_data; return save_data;
} }
fprintf_filtered (stream, gdb_printf (stream,
_("a variable at frame base reg $%s offset %s+%s"), _("a variable at frame base reg $%s offset %s+%s"),
locexpr_regname (gdbarch, frame_reg), locexpr_regname (gdbarch, frame_reg),
plongest (base_offset), plongest (frame_offset)); plongest (base_offset), plongest (frame_offset));
} }
else if (data[0] >= DW_OP_breg0 && data[0] <= DW_OP_breg31 else if (data[0] >= DW_OP_breg0 && data[0] <= DW_OP_breg31
&& piece_end_p (data, end)) && piece_end_p (data, end))
@ -3222,10 +3222,10 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
data = safe_read_sleb128 (data + 1, end, &offset); data = safe_read_sleb128 (data + 1, end, &offset);
fprintf_filtered (stream, gdb_printf (stream,
_("a variable at offset %s from base reg $%s"), _("a variable at offset %s from base reg $%s"),
plongest (offset), plongest (offset),
locexpr_regname (gdbarch, data[0] - DW_OP_breg0)); locexpr_regname (gdbarch, data[0] - DW_OP_breg0));
} }
/* The location expression for a TLS variable looks like this (on a /* The location expression for a TLS variable looks like this (on a
@ -3254,10 +3254,10 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
offset = extract_unsigned_integer (data + 1, addr_size, offset = extract_unsigned_integer (data + 1, addr_size,
gdbarch_byte_order (gdbarch)); gdbarch_byte_order (gdbarch));
fprintf_filtered (stream, gdb_printf (stream,
_("a thread-local variable at offset 0x%s " _("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"), "in the thread-local storage for `%s'"),
phex_nz (offset, addr_size), objfile_name (objfile)); phex_nz (offset, addr_size), objfile_name (objfile));
data += 1 + addr_size + 1; data += 1 + addr_size + 1;
} }
@ -3278,10 +3278,10 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
data = safe_read_uleb128 (data + 1, end, &offset); data = safe_read_uleb128 (data + 1, end, &offset);
offset = dwarf2_read_addr_index (per_cu, per_objfile, offset); offset = dwarf2_read_addr_index (per_cu, per_objfile, offset);
fprintf_filtered (stream, gdb_printf (stream,
_("a thread-local variable at offset 0x%s " _("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"), "in the thread-local storage for `%s'"),
phex_nz (offset, addr_size), objfile_name (objfile)); phex_nz (offset, addr_size), objfile_name (objfile));
++data; ++data;
} }
@ -3290,7 +3290,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
&& data + 1 < end && data + 1 < end
&& data[1] == DW_OP_stack_value) && data[1] == DW_OP_stack_value)
{ {
fprintf_filtered (stream, _("the constant %d"), data[0] - DW_OP_lit0); gdb_printf (stream, _("the constant %d"), data[0] - DW_OP_lit0);
data += 2; data += 2;
} }
@ -3327,8 +3327,8 @@ disassemble_dwarf_expression (struct ui_file *stream,
if (!name) if (!name)
error (_("Unrecognized DWARF opcode 0x%02x at %ld"), error (_("Unrecognized DWARF opcode 0x%02x at %ld"),
op, (long) (data - 1 - start)); op, (long) (data - 1 - start));
fprintf_filtered (stream, " %*ld: %s", indent + 4, gdb_printf (stream, " %*ld: %s", indent + 4,
(long) (data - 1 - start), name); (long) (data - 1 - start), name);
switch (op) switch (op)
{ {
@ -3336,65 +3336,65 @@ disassemble_dwarf_expression (struct ui_file *stream,
ul = extract_unsigned_integer (data, addr_size, ul = extract_unsigned_integer (data, addr_size,
gdbarch_byte_order (arch)); gdbarch_byte_order (arch));
data += addr_size; data += addr_size;
fprintf_filtered (stream, " 0x%s", phex_nz (ul, addr_size)); gdb_printf (stream, " 0x%s", phex_nz (ul, addr_size));
break; break;
case DW_OP_const1u: case DW_OP_const1u:
ul = extract_unsigned_integer (data, 1, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 1, gdbarch_byte_order (arch));
data += 1; data += 1;
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_const1s: case DW_OP_const1s:
l = extract_signed_integer (data, 1, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 1, gdbarch_byte_order (arch));
data += 1; data += 1;
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_const2u: case DW_OP_const2u:
ul = extract_unsigned_integer (data, 2, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 2, gdbarch_byte_order (arch));
data += 2; data += 2;
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_const2s: case DW_OP_const2s:
l = extract_signed_integer (data, 2, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 2, gdbarch_byte_order (arch));
data += 2; data += 2;
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_const4u: case DW_OP_const4u:
ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch));
data += 4; data += 4;
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_const4s: case DW_OP_const4s:
l = extract_signed_integer (data, 4, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 4, gdbarch_byte_order (arch));
data += 4; data += 4;
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_const8u: case DW_OP_const8u:
ul = extract_unsigned_integer (data, 8, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 8, gdbarch_byte_order (arch));
data += 8; data += 8;
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_const8s: case DW_OP_const8s:
l = extract_signed_integer (data, 8, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 8, gdbarch_byte_order (arch));
data += 8; data += 8;
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_constu: case DW_OP_constu:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_consts: case DW_OP_consts:
data = safe_read_sleb128 (data, end, &l); data = safe_read_sleb128 (data, end, &l);
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_reg0: case DW_OP_reg0:
@ -3429,20 +3429,20 @@ disassemble_dwarf_expression (struct ui_file *stream,
case DW_OP_reg29: case DW_OP_reg29:
case DW_OP_reg30: case DW_OP_reg30:
case DW_OP_reg31: case DW_OP_reg31:
fprintf_filtered (stream, " [$%s]", gdb_printf (stream, " [$%s]",
locexpr_regname (arch, op - DW_OP_reg0)); locexpr_regname (arch, op - DW_OP_reg0));
break; break;
case DW_OP_regx: case DW_OP_regx:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
fprintf_filtered (stream, " %s [$%s]", pulongest (ul), gdb_printf (stream, " %s [$%s]", pulongest (ul),
locexpr_regname (arch, (int) ul)); locexpr_regname (arch, (int) ul));
break; break;
case DW_OP_implicit_value: case DW_OP_implicit_value:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
data += ul; data += ul;
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_breg0: case DW_OP_breg0:
@ -3478,72 +3478,72 @@ disassemble_dwarf_expression (struct ui_file *stream,
case DW_OP_breg30: case DW_OP_breg30:
case DW_OP_breg31: case DW_OP_breg31:
data = safe_read_sleb128 (data, end, &l); data = safe_read_sleb128 (data, end, &l);
fprintf_filtered (stream, " %s [$%s]", plongest (l), gdb_printf (stream, " %s [$%s]", plongest (l),
locexpr_regname (arch, op - DW_OP_breg0)); locexpr_regname (arch, op - DW_OP_breg0));
break; break;
case DW_OP_bregx: case DW_OP_bregx:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
data = safe_read_sleb128 (data, end, &l); data = safe_read_sleb128 (data, end, &l);
fprintf_filtered (stream, " register %s [$%s] offset %s", gdb_printf (stream, " register %s [$%s] offset %s",
pulongest (ul), pulongest (ul),
locexpr_regname (arch, (int) ul), locexpr_regname (arch, (int) ul),
plongest (l)); plongest (l));
break; break;
case DW_OP_fbreg: case DW_OP_fbreg:
data = safe_read_sleb128 (data, end, &l); data = safe_read_sleb128 (data, end, &l);
fprintf_filtered (stream, " %s", plongest (l)); gdb_printf (stream, " %s", plongest (l));
break; break;
case DW_OP_xderef_size: case DW_OP_xderef_size:
case DW_OP_deref_size: case DW_OP_deref_size:
case DW_OP_pick: case DW_OP_pick:
fprintf_filtered (stream, " %d", *data); gdb_printf (stream, " %d", *data);
++data; ++data;
break; break;
case DW_OP_plus_uconst: case DW_OP_plus_uconst:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_skip: case DW_OP_skip:
l = extract_signed_integer (data, 2, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 2, gdbarch_byte_order (arch));
data += 2; data += 2;
fprintf_filtered (stream, " to %ld", gdb_printf (stream, " to %ld",
(long) (data + l - start)); (long) (data + l - start));
break; break;
case DW_OP_bra: case DW_OP_bra:
l = extract_signed_integer (data, 2, gdbarch_byte_order (arch)); l = extract_signed_integer (data, 2, gdbarch_byte_order (arch));
data += 2; data += 2;
fprintf_filtered (stream, " %ld", gdb_printf (stream, " %ld",
(long) (data + l - start)); (long) (data + l - start));
break; break;
case DW_OP_call2: case DW_OP_call2:
ul = extract_unsigned_integer (data, 2, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 2, gdbarch_byte_order (arch));
data += 2; data += 2;
fprintf_filtered (stream, " offset %s", phex_nz (ul, 2)); gdb_printf (stream, " offset %s", phex_nz (ul, 2));
break; break;
case DW_OP_call4: case DW_OP_call4:
ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch));
data += 4; data += 4;
fprintf_filtered (stream, " offset %s", phex_nz (ul, 4)); gdb_printf (stream, " offset %s", phex_nz (ul, 4));
break; break;
case DW_OP_call_ref: case DW_OP_call_ref:
ul = extract_unsigned_integer (data, offset_size, ul = extract_unsigned_integer (data, offset_size,
gdbarch_byte_order (arch)); gdbarch_byte_order (arch));
data += offset_size; data += offset_size;
fprintf_filtered (stream, " offset %s", phex_nz (ul, offset_size)); gdb_printf (stream, " offset %s", phex_nz (ul, offset_size));
break; break;
case DW_OP_piece: case DW_OP_piece:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
fprintf_filtered (stream, " %s (bytes)", pulongest (ul)); gdb_printf (stream, " %s (bytes)", pulongest (ul));
break; break;
case DW_OP_bit_piece: case DW_OP_bit_piece:
@ -3552,8 +3552,8 @@ disassemble_dwarf_expression (struct ui_file *stream,
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
data = safe_read_uleb128 (data, end, &offset); data = safe_read_uleb128 (data, end, &offset);
fprintf_filtered (stream, " size %s offset %s (bits)", gdb_printf (stream, " size %s offset %s (bits)",
pulongest (ul), pulongest (offset)); pulongest (ul), pulongest (offset));
} }
break; break;
@ -3566,9 +3566,9 @@ disassemble_dwarf_expression (struct ui_file *stream,
data = safe_read_sleb128 (data, end, &l); data = safe_read_sleb128 (data, end, &l);
fprintf_filtered (stream, " DIE %s offset %s", gdb_printf (stream, " DIE %s offset %s",
phex_nz (ul, offset_size), phex_nz (ul, offset_size),
plongest (l)); plongest (l));
} }
break; break;
@ -3581,11 +3581,11 @@ disassemble_dwarf_expression (struct ui_file *stream,
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
cu_offset offset = (cu_offset) ul; cu_offset offset = (cu_offset) ul;
type = dwarf2_get_die_type (offset, per_cu, per_objfile); type = dwarf2_get_die_type (offset, per_cu, per_objfile);
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]> %d", gdb_printf (stream, " [0x%s]> %d",
phex_nz (to_underlying (offset), 0), phex_nz (to_underlying (offset), 0),
deref_addr_size); deref_addr_size);
} }
break; break;
@ -3597,15 +3597,15 @@ disassemble_dwarf_expression (struct ui_file *stream,
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
cu_offset type_die = (cu_offset) ul; cu_offset type_die = (cu_offset) ul;
type = dwarf2_get_die_type (type_die, per_cu, per_objfile); type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]>", gdb_printf (stream, " [0x%s]>",
phex_nz (to_underlying (type_die), 0)); phex_nz (to_underlying (type_die), 0));
int n = *data++; int n = *data++;
fprintf_filtered (stream, " %d byte block:", n); gdb_printf (stream, " %d byte block:", n);
for (int i = 0; i < n; ++i) for (int i = 0; i < n; ++i)
fprintf_filtered (stream, " %02x", data[i]); gdb_printf (stream, " %02x", data[i]);
data += n; data += n;
} }
break; break;
@ -3621,11 +3621,11 @@ disassemble_dwarf_expression (struct ui_file *stream,
cu_offset type_die = (cu_offset) ul; cu_offset type_die = (cu_offset) ul;
type = dwarf2_get_die_type (type_die, per_cu, per_objfile); type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]> [$%s]", gdb_printf (stream, " [0x%s]> [$%s]",
phex_nz (to_underlying (type_die), 0), phex_nz (to_underlying (type_die), 0),
locexpr_regname (arch, reg)); locexpr_regname (arch, reg));
} }
break; break;
@ -3638,16 +3638,16 @@ disassemble_dwarf_expression (struct ui_file *stream,
cu_offset type_die = (cu_offset) ul; cu_offset type_die = (cu_offset) ul;
if (to_underlying (type_die) == 0) if (to_underlying (type_die) == 0)
fprintf_filtered (stream, "<0>"); gdb_printf (stream, "<0>");
else else
{ {
struct type *type; struct type *type;
type = dwarf2_get_die_type (type_die, per_cu, per_objfile); type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<"); gdb_printf (stream, "<");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]>", gdb_printf (stream, " [0x%s]>",
phex_nz (to_underlying (type_die), 0)); phex_nz (to_underlying (type_die), 0));
} }
} }
break; break;
@ -3665,31 +3665,31 @@ disassemble_dwarf_expression (struct ui_file *stream,
case DW_OP_GNU_parameter_ref: case DW_OP_GNU_parameter_ref:
ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch)); ul = extract_unsigned_integer (data, 4, gdbarch_byte_order (arch));
data += 4; data += 4;
fprintf_filtered (stream, " offset %s", phex_nz (ul, 4)); gdb_printf (stream, " offset %s", phex_nz (ul, 4));
break; break;
case DW_OP_addrx: case DW_OP_addrx:
case DW_OP_GNU_addr_index: case DW_OP_GNU_addr_index:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
ul = dwarf2_read_addr_index (per_cu, per_objfile, ul); ul = dwarf2_read_addr_index (per_cu, per_objfile, ul);
fprintf_filtered (stream, " 0x%s", phex_nz (ul, addr_size)); gdb_printf (stream, " 0x%s", phex_nz (ul, addr_size));
break; break;
case DW_OP_GNU_const_index: case DW_OP_GNU_const_index:
data = safe_read_uleb128 (data, end, &ul); data = safe_read_uleb128 (data, end, &ul);
ul = dwarf2_read_addr_index (per_cu, per_objfile, ul); ul = dwarf2_read_addr_index (per_cu, per_objfile, ul);
fprintf_filtered (stream, " %s", pulongest (ul)); gdb_printf (stream, " %s", pulongest (ul));
break; break;
case DW_OP_GNU_variable_value: case DW_OP_GNU_variable_value:
ul = extract_unsigned_integer (data, offset_size, ul = extract_unsigned_integer (data, offset_size,
gdbarch_byte_order (arch)); gdbarch_byte_order (arch));
data += offset_size; data += offset_size;
fprintf_filtered (stream, " offset %s", phex_nz (ul, offset_size)); gdb_printf (stream, " offset %s", phex_nz (ul, offset_size));
break; break;
} }
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
} }
return data; return data;
@ -3701,10 +3701,10 @@ static void
show_dwarf_always_disassemble (struct ui_file *file, int from_tty, show_dwarf_always_disassemble (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Whether to always disassemble " _("Whether to always disassemble "
"DWARF expressions is %s.\n"), "DWARF expressions is %s.\n"),
value); value);
} }
/* Describe a single location, which may in turn consist of multiple /* Describe a single location, which may in turn consist of multiple
@ -3730,7 +3730,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
if (first_piece) if (first_piece)
first_piece = 0; first_piece = 0;
else else
fprintf_filtered (stream, _(", and ")); gdb_printf (stream, _(", and "));
if (!dwarf_always_disassemble) if (!dwarf_always_disassemble)
{ {
@ -3746,7 +3746,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
} }
if (disassemble) if (disassemble)
{ {
fprintf_filtered (stream, _("a complex DWARF expression:\n")); gdb_printf (stream, _("a complex DWARF expression:\n"));
data = disassemble_dwarf_expression (stream, data = disassemble_dwarf_expression (stream,
objfile->arch (), objfile->arch (),
addr_size, offset_size, data, addr_size, offset_size, data,
@ -3760,7 +3760,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
int empty = data == here; int empty = data == here;
if (disassemble) if (disassemble)
fprintf_filtered (stream, " "); gdb_printf (stream, " ");
if (data[0] == DW_OP_piece) if (data[0] == DW_OP_piece)
{ {
uint64_t bytes; uint64_t bytes;
@ -3768,11 +3768,11 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
data = safe_read_uleb128 (data + 1, end, &bytes); data = safe_read_uleb128 (data + 1, end, &bytes);
if (empty) if (empty)
fprintf_filtered (stream, _("an empty %s-byte piece"), gdb_printf (stream, _("an empty %s-byte piece"),
pulongest (bytes)); pulongest (bytes));
else else
fprintf_filtered (stream, _(" [%s-byte piece]"), gdb_printf (stream, _(" [%s-byte piece]"),
pulongest (bytes)); pulongest (bytes));
} }
else if (data[0] == DW_OP_bit_piece) else if (data[0] == DW_OP_bit_piece)
{ {
@ -3782,13 +3782,13 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
data = safe_read_uleb128 (data, end, &offset); data = safe_read_uleb128 (data, end, &offset);
if (empty) if (empty)
fprintf_filtered (stream, gdb_printf (stream,
_("an empty %s-bit piece"), _("an empty %s-bit piece"),
pulongest (bits)); pulongest (bits));
else else
fprintf_filtered (stream, gdb_printf (stream,
_(" [%s-bit piece, offset %s bits]"), _(" [%s-bit piece, offset %s bits]"),
pulongest (bits), pulongest (offset)); pulongest (bits), pulongest (offset));
} }
else else
{ {
@ -3964,7 +3964,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
loc_ptr = dlbaton->data; loc_ptr = dlbaton->data;
buf_end = dlbaton->data + dlbaton->size; buf_end = dlbaton->data + dlbaton->size;
fprintf_filtered (stream, _("multi-location:\n")); gdb_printf (stream, _("multi-location:\n"));
/* Iterate through locations until we run out. */ /* Iterate through locations until we run out. */
while (!done) while (!done)
@ -3999,8 +3999,8 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
case DEBUG_LOC_BASE_ADDRESS: case DEBUG_LOC_BASE_ADDRESS:
base_address = high; base_address = high;
fprintf_filtered (stream, _(" Base address %s"), gdb_printf (stream, _(" Base address %s"),
paddress (gdbarch, base_address)); paddress (gdbarch, base_address));
continue; continue;
case DEBUG_LOC_START_END: case DEBUG_LOC_START_END:
@ -4043,15 +4043,15 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
/* (It would improve readability to print only the minimum /* (It would improve readability to print only the minimum
necessary digits of the second number of the range.) */ necessary digits of the second number of the range.) */
fprintf_filtered (stream, _(" Range %s-%s: "), gdb_printf (stream, _(" Range %s-%s: "),
paddress (gdbarch, low), paddress (gdbarch, high)); paddress (gdbarch, low), paddress (gdbarch, high));
/* Now describe this particular location. */ /* Now describe this particular location. */
locexpr_describe_location_1 (symbol, low, stream, loc_ptr, length, locexpr_describe_location_1 (symbol, low, stream, loc_ptr, length,
addr_size, offset_size, addr_size, offset_size,
dlbaton->per_cu, dlbaton->per_objfile); dlbaton->per_cu, dlbaton->per_objfile);
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
loc_ptr += length; loc_ptr += length;
} }

View file

@ -1090,9 +1090,9 @@ static void
show_dwarf_max_cache_age (struct ui_file *file, int from_tty, show_dwarf_max_cache_age (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("The upper bound on the age of cached " gdb_printf (file, _("The upper bound on the age of cached "
"DWARF compilation units is %s.\n"), "DWARF compilation units is %s.\n"),
value); value);
} }
/* local function prototypes */ /* local function prototypes */
@ -3311,8 +3311,8 @@ dwarf2_base_index_functions::print_stats (struct objfile *objfile,
if (!per_objfile->symtab_set_p (per_cu)) if (!per_objfile->symtab_set_p (per_cu))
++count; ++count;
} }
printf_filtered (_(" Number of read CUs: %d\n"), total - count); gdb_printf (_(" Number of read CUs: %d\n"), total - count);
printf_filtered (_(" Number of unread CUs: %d\n"), count); gdb_printf (_(" Number of unread CUs: %d\n"), count);
} }
/* This dumps minimal information about the index. /* This dumps minimal information about the index.
@ -3326,15 +3326,15 @@ dwarf2_gdb_index::dump (struct objfile *objfile)
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile); dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
gdb_assert (per_objfile->per_bfd->using_index); gdb_assert (per_objfile->per_bfd->using_index);
printf_filtered (".gdb_index:"); gdb_printf (".gdb_index:");
if (per_objfile->per_bfd->index_table != NULL) if (per_objfile->per_bfd->index_table != NULL)
{ {
printf_filtered (" version %d\n", gdb_printf (" version %d\n",
per_objfile->per_bfd->index_table->version); per_objfile->per_bfd->index_table->version);
} }
else else
printf_filtered (" faked for \"readnow\"\n"); gdb_printf (" faked for \"readnow\"\n");
printf_filtered ("\n"); gdb_printf ("\n");
} }
void void
@ -5334,12 +5334,12 @@ dwarf2_debug_names_index::dump (struct objfile *objfile)
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile); dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
gdb_assert (per_objfile->per_bfd->using_index); gdb_assert (per_objfile->per_bfd->using_index);
printf_filtered (".debug_names:"); gdb_printf (".debug_names:");
if (per_objfile->per_bfd->debug_names_table) if (per_objfile->per_bfd->debug_names_table)
printf_filtered (" exists\n"); gdb_printf (" exists\n");
else else
printf_filtered (" faked for \"readnow\"\n"); gdb_printf (" faked for \"readnow\"\n");
printf_filtered ("\n"); gdb_printf ("\n");
} }
void void
@ -6390,11 +6390,11 @@ read_cutu_die_from_dwo (dwarf2_cu *cu,
if (dwarf_die_debug) if (dwarf_die_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Read die from %s@0x%x of %s:\n", "Read die from %s@0x%x of %s:\n",
section->get_name (), section->get_name (),
(unsigned) (begin_info_ptr - section->buffer), (unsigned) (begin_info_ptr - section->buffer),
bfd_get_filename (abfd)); bfd_get_filename (abfd));
dump_die (comp_unit_die, dwarf_die_debug); dump_die (comp_unit_die, dwarf_die_debug);
} }
@ -6537,9 +6537,9 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
int rereading_dwo_cu = 0; int rereading_dwo_cu = 0;
if (dwarf_die_debug) if (dwarf_die_debug)
fprintf_unfiltered (gdb_stdlog, "Reading %s unit at offset %s\n", gdb_printf (gdb_stdlog, "Reading %s unit at offset %s\n",
this_cu->is_debug_types ? "type" : "comp", this_cu->is_debug_types ? "type" : "comp",
sect_offset_str (this_cu->sect_off)); sect_offset_str (this_cu->sect_off));
/* If we're reading a TU directly from a DWO file, including a virtual DWO /* If we're reading a TU directly from a DWO file, including a virtual DWO
file (instead of going through the stub), short-circuit all of this. */ file (instead of going through the stub), short-circuit all of this. */
@ -6752,9 +6752,9 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
const gdb_byte *begin_info_ptr, *info_ptr; const gdb_byte *begin_info_ptr, *info_ptr;
if (dwarf_die_debug) if (dwarf_die_debug)
fprintf_unfiltered (gdb_stdlog, "Reading %s unit at offset %s\n", gdb_printf (gdb_stdlog, "Reading %s unit at offset %s\n",
this_cu->is_debug_types ? "type" : "comp", this_cu->is_debug_types ? "type" : "comp",
sect_offset_str (this_cu->sect_off)); sect_offset_str (this_cu->sect_off));
gdb_assert (per_objfile->get_cu (this_cu) == nullptr); gdb_assert (per_objfile->get_cu (this_cu) == nullptr);
@ -18860,11 +18860,11 @@ read_die_and_siblings (const struct die_reader_specs *reader,
if (dwarf_die_debug) if (dwarf_die_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Read die from %s@0x%x of %s:\n", "Read die from %s@0x%x of %s:\n",
reader->die_section->get_name (), reader->die_section->get_name (),
(unsigned) (info_ptr - reader->die_section->buffer), (unsigned) (info_ptr - reader->die_section->buffer),
bfd_get_filename (reader->abfd)); bfd_get_filename (reader->abfd));
dump_die (die, dwarf_die_debug); dump_die (die, dwarf_die_debug);
} }
@ -18966,11 +18966,11 @@ read_full_die (const struct die_reader_specs *reader,
if (dwarf_die_debug) if (dwarf_die_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Read die from %s@0x%x of %s:\n", "Read die from %s@0x%x of %s:\n",
reader->die_section->get_name (), reader->die_section->get_name (),
(unsigned) (info_ptr - reader->die_section->buffer), (unsigned) (info_ptr - reader->die_section->buffer),
bfd_get_filename (reader->abfd)); bfd_get_filename (reader->abfd));
dump_die (*diep, dwarf_die_debug); dump_die (*diep, dwarf_die_debug);
} }
@ -21131,10 +21131,10 @@ dwarf_record_line_1 (struct gdbarch *gdbarch, struct subfile *subfile,
if (dwarf_line_debug) if (dwarf_line_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Recording line %u, file %s, address %s\n", "Recording line %u, file %s, address %s\n",
line, lbasename (subfile->name), line, lbasename (subfile->name),
paddress (gdbarch, address)); paddress (gdbarch, address));
} }
if (cu != nullptr) if (cu != nullptr)
@ -21155,10 +21155,10 @@ dwarf_finish_line (struct gdbarch *gdbarch, struct subfile *subfile,
if (dwarf_line_debug) if (dwarf_line_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Finishing current line, file %s, address %s\n", "Finishing current line, file %s, address %s\n",
lbasename (subfile->name), lbasename (subfile->name),
paddress (gdbarch, address)); paddress (gdbarch, address));
} }
dwarf_record_line_1 (gdbarch, subfile, 0, address, true, cu); dwarf_record_line_1 (gdbarch, subfile, 0, address, true, cu);
@ -21169,13 +21169,13 @@ lnp_state_machine::record_line (bool end_sequence)
{ {
if (dwarf_line_debug) if (dwarf_line_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Processing actual line %u: file %u," "Processing actual line %u: file %u,"
" address %s, is_stmt %u, discrim %u%s\n", " address %s, is_stmt %u, discrim %u%s\n",
m_line, m_file, m_line, m_file,
paddress (m_gdbarch, m_address), paddress (m_gdbarch, m_address),
m_is_stmt, m_discriminator, m_is_stmt, m_discriminator,
(end_sequence ? "\t(end sequence)" : "")); (end_sequence ? "\t(end sequence)" : ""));
} }
file_entry *fe = current_file (); file_entry *fe = current_file ();
@ -23065,57 +23065,57 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
{ {
unsigned int i; unsigned int i;
fprintf_unfiltered (f, "%*sDie: %s (abbrev %d, offset %s)\n", gdb_printf (f, "%*sDie: %s (abbrev %d, offset %s)\n",
indent, "", indent, "",
dwarf_tag_name (die->tag), die->abbrev, dwarf_tag_name (die->tag), die->abbrev,
sect_offset_str (die->sect_off)); sect_offset_str (die->sect_off));
if (die->parent != NULL) if (die->parent != NULL)
fprintf_unfiltered (f, "%*s parent at offset: %s\n", gdb_printf (f, "%*s parent at offset: %s\n",
indent, "", indent, "",
sect_offset_str (die->parent->sect_off)); sect_offset_str (die->parent->sect_off));
fprintf_unfiltered (f, "%*s has children: %s\n", gdb_printf (f, "%*s has children: %s\n",
indent, "", indent, "",
dwarf_bool_name (die->child != NULL)); dwarf_bool_name (die->child != NULL));
fprintf_unfiltered (f, "%*s attributes:\n", indent, ""); gdb_printf (f, "%*s attributes:\n", indent, "");
for (i = 0; i < die->num_attrs; ++i) for (i = 0; i < die->num_attrs; ++i)
{ {
fprintf_unfiltered (f, "%*s %s (%s) ", gdb_printf (f, "%*s %s (%s) ",
indent, "", indent, "",
dwarf_attr_name (die->attrs[i].name), dwarf_attr_name (die->attrs[i].name),
dwarf_form_name (die->attrs[i].form)); dwarf_form_name (die->attrs[i].form));
switch (die->attrs[i].form) switch (die->attrs[i].form)
{ {
case DW_FORM_addr: case DW_FORM_addr:
case DW_FORM_addrx: case DW_FORM_addrx:
case DW_FORM_GNU_addr_index: case DW_FORM_GNU_addr_index:
fprintf_unfiltered (f, "address: "); gdb_printf (f, "address: ");
gdb_puts (hex_string (die->attrs[i].as_address ()), f); gdb_puts (hex_string (die->attrs[i].as_address ()), f);
break; break;
case DW_FORM_block2: case DW_FORM_block2:
case DW_FORM_block4: case DW_FORM_block4:
case DW_FORM_block: case DW_FORM_block:
case DW_FORM_block1: case DW_FORM_block1:
fprintf_unfiltered (f, "block: size %s", gdb_printf (f, "block: size %s",
pulongest (die->attrs[i].as_block ()->size)); pulongest (die->attrs[i].as_block ()->size));
break; break;
case DW_FORM_exprloc: case DW_FORM_exprloc:
fprintf_unfiltered (f, "expression: size %s", gdb_printf (f, "expression: size %s",
pulongest (die->attrs[i].as_block ()->size)); pulongest (die->attrs[i].as_block ()->size));
break; break;
case DW_FORM_data16: case DW_FORM_data16:
fprintf_unfiltered (f, "constant of 16 bytes"); gdb_printf (f, "constant of 16 bytes");
break; break;
case DW_FORM_ref_addr: case DW_FORM_ref_addr:
fprintf_unfiltered (f, "ref address: "); gdb_printf (f, "ref address: ");
gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f); gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f);
break; break;
case DW_FORM_GNU_ref_alt: case DW_FORM_GNU_ref_alt:
fprintf_unfiltered (f, "alt ref address: "); gdb_printf (f, "alt ref address: ");
gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f); gdb_puts (hex_string (die->attrs[i].as_unsigned ()), f);
break; break;
case DW_FORM_ref1: case DW_FORM_ref1:
@ -23123,24 +23123,24 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
case DW_FORM_ref4: case DW_FORM_ref4:
case DW_FORM_ref8: case DW_FORM_ref8:
case DW_FORM_ref_udata: case DW_FORM_ref_udata:
fprintf_unfiltered (f, "constant ref: 0x%lx (adjusted)", gdb_printf (f, "constant ref: 0x%lx (adjusted)",
(long) (die->attrs[i].as_unsigned ())); (long) (die->attrs[i].as_unsigned ()));
break; break;
case DW_FORM_data1: case DW_FORM_data1:
case DW_FORM_data2: case DW_FORM_data2:
case DW_FORM_data4: case DW_FORM_data4:
case DW_FORM_data8: case DW_FORM_data8:
case DW_FORM_udata: case DW_FORM_udata:
fprintf_unfiltered (f, "constant: %s", gdb_printf (f, "constant: %s",
pulongest (die->attrs[i].as_unsigned ())); pulongest (die->attrs[i].as_unsigned ()));
break; break;
case DW_FORM_sec_offset: case DW_FORM_sec_offset:
fprintf_unfiltered (f, "section offset: %s", gdb_printf (f, "section offset: %s",
pulongest (die->attrs[i].as_unsigned ())); pulongest (die->attrs[i].as_unsigned ()));
break; break;
case DW_FORM_ref_sig8: case DW_FORM_ref_sig8:
fprintf_unfiltered (f, "signature: %s", gdb_printf (f, "signature: %s",
hex_string (die->attrs[i].as_signature ())); hex_string (die->attrs[i].as_signature ()));
break; break;
case DW_FORM_string: case DW_FORM_string:
case DW_FORM_strp: case DW_FORM_strp:
@ -23148,37 +23148,37 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
case DW_FORM_strx: case DW_FORM_strx:
case DW_FORM_GNU_str_index: case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt: case DW_FORM_GNU_strp_alt:
fprintf_unfiltered (f, "string: \"%s\" (%s canonicalized)", gdb_printf (f, "string: \"%s\" (%s canonicalized)",
die->attrs[i].as_string () die->attrs[i].as_string ()
? die->attrs[i].as_string () : "", ? die->attrs[i].as_string () : "",
die->attrs[i].canonical_string_p () ? "is" : "not"); die->attrs[i].canonical_string_p () ? "is" : "not");
break; break;
case DW_FORM_flag: case DW_FORM_flag:
if (die->attrs[i].as_boolean ()) if (die->attrs[i].as_boolean ())
fprintf_unfiltered (f, "flag: TRUE"); gdb_printf (f, "flag: TRUE");
else else
fprintf_unfiltered (f, "flag: FALSE"); gdb_printf (f, "flag: FALSE");
break; break;
case DW_FORM_flag_present: case DW_FORM_flag_present:
fprintf_unfiltered (f, "flag: TRUE"); gdb_printf (f, "flag: TRUE");
break; break;
case DW_FORM_indirect: case DW_FORM_indirect:
/* The reader will have reduced the indirect form to /* The reader will have reduced the indirect form to
the "base form" so this form should not occur. */ the "base form" so this form should not occur. */
fprintf_unfiltered (f, gdb_printf (f,
"unexpected attribute form: DW_FORM_indirect"); "unexpected attribute form: DW_FORM_indirect");
break; break;
case DW_FORM_sdata: case DW_FORM_sdata:
case DW_FORM_implicit_const: case DW_FORM_implicit_const:
fprintf_unfiltered (f, "constant: %s", gdb_printf (f, "constant: %s",
plongest (die->attrs[i].as_signed ())); plongest (die->attrs[i].as_signed ()));
break; break;
default: default:
fprintf_unfiltered (f, "unsupported attribute form: %d.", gdb_printf (f, "unsupported attribute form: %d.",
die->attrs[i].form); die->attrs[i].form);
break; break;
} }
fprintf_unfiltered (f, "\n"); gdb_printf (f, "\n");
} }
} }
@ -23202,16 +23202,16 @@ dump_die_1 (struct ui_file *f, int level, int max_level, struct die_info *die)
if (die->child != NULL) if (die->child != NULL)
{ {
fprintf_unfiltered (f, "%*s Children:", indent, ""); gdb_printf (f, "%*s Children:", indent, "");
if (level + 1 < max_level) if (level + 1 < max_level)
{ {
fprintf_unfiltered (f, "\n"); gdb_printf (f, "\n");
dump_die_1 (f, level + 1, max_level, die->child); dump_die_1 (f, level + 1, max_level, die->child);
} }
else else
{ {
fprintf_unfiltered (f, gdb_printf (f,
" [not printed, max nesting level reached]\n"); " [not printed, max nesting level reached]\n");
} }
} }
@ -24942,9 +24942,9 @@ static void
show_check_physname (struct ui_file *file, int from_tty, show_check_physname (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Whether to check \"physname\" is %s.\n"), _("Whether to check \"physname\" is %s.\n"),
value); value);
} }
void _initialize_dwarf2_read (); void _initialize_dwarf2_read ();

View file

@ -1049,9 +1049,9 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
if (symtab_create_debug) if (symtab_create_debug)
{ {
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"Reading minimal symbols of objfile %s ...\n", "Reading minimal symbols of objfile %s ...\n",
objfile_name (objfile)); objfile_name (objfile));
} }
/* If we already have minsyms, then we can skip some work here. /* If we already have minsyms, then we can skip some work here.
@ -1065,8 +1065,8 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
&& ei->ctfsect == NULL) && ei->ctfsect == NULL)
{ {
if (symtab_create_debug) if (symtab_create_debug)
fprintf_unfiltered (gdb_stdlog, gdb_printf (gdb_stdlog,
"... minimal symbols previously read\n"); "... minimal symbols previously read\n");
return; return;
} }
@ -1171,7 +1171,7 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
reader.install (); reader.install ();
if (symtab_create_debug) if (symtab_create_debug)
fprintf_unfiltered (gdb_stdlog, "Done reading minimal symbols.\n"); gdb_printf (gdb_stdlog, "Done reading minimal symbols.\n");
} }
/* Scan and build partial symbols for a symbol file. /* Scan and build partial symbols for a symbol file.

View file

@ -108,7 +108,7 @@ static void
show_bt_on_fatal_signal (struct ui_file *file, int from_tty, show_bt_on_fatal_signal (struct ui_file *file, int from_tty,
struct cmd_list_element *cmd, const char *value) struct cmd_list_element *cmd, const char *value)
{ {
fprintf_filtered (file, _("Backtrace on a fatal signal is %s.\n"), value); gdb_printf (file, _("Backtrace on a fatal signal is %s.\n"), value);
} }
/* Signal handling variables. */ /* Signal handling variables. */
@ -495,7 +495,7 @@ stdin_event_handler (int error, gdb_client_data client_data)
if (main_ui == ui) if (main_ui == ui)
{ {
/* If stdin died, we may as well kill gdb. */ /* If stdin died, we may as well kill gdb. */
fprintf_unfiltered (gdb_stderr, _("error detected on stdin\n")); gdb_printf (gdb_stderr, _("error detected on stdin\n"));
quit_command ((char *) 0, 0); quit_command ((char *) 0, 0);
} }
else else
@ -1406,7 +1406,7 @@ static void
show_debug_event_loop_command (struct ui_file *file, int from_tty, show_debug_event_loop_command (struct ui_file *file, int from_tty,
struct cmd_list_element *cmd, const char *value) struct cmd_list_element *cmd, const char *value)
{ {
fprintf_filtered (file, _("Event loop debugging is %s.\n"), value); gdb_printf (file, _("Event loop debugging is %s.\n"), value);
} }
void _initialize_event_top (); void _initialize_event_top ();

View file

@ -88,7 +88,7 @@ print_exception (struct ui_file *file, const struct gdb_exception &e)
file->write (start, end - start); file->write (start, end - start);
} }
} }
fprintf_filtered (file, "\n"); gdb_printf (file, "\n");
/* Now append the annotation. */ /* Now append the annotation. */
switch (e.reason) switch (e.reason)

View file

@ -103,9 +103,9 @@ static void
show_exec_file_mismatch_command (struct ui_file *file, int from_tty, show_exec_file_mismatch_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("exec-file-mismatch handling is currently \"%s\".\n"), _("exec-file-mismatch handling is currently \"%s\".\n"),
exec_file_mismatch_names[exec_file_mismatch_mode]); exec_file_mismatch_names[exec_file_mismatch_mode]);
} }
/* Set command. Change the setting for range checking. */ /* Set command. Change the setting for range checking. */
@ -136,8 +136,8 @@ static void
show_write_files (struct ui_file *file, int from_tty, show_write_files (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Writing into executable and core files is %s.\n"), gdb_printf (file, _("Writing into executable and core files is %s.\n"),
value); value);
} }
@ -379,7 +379,7 @@ exec_file_attach (const char *filename, int from_tty)
if (!filename) if (!filename)
{ {
if (from_tty) if (from_tty)
printf_filtered (_("No executable file now.\n")); gdb_printf (_("No executable file now.\n"));
set_gdbarch_from_file (NULL); set_gdbarch_from_file (NULL);
} }
@ -906,11 +906,11 @@ print_section_info (const target_section_table *t, bfd *abfd)
/* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */ /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */
int wid = gdbarch_addr_bit (gdbarch) <= 32 ? 8 : 16; int wid = gdbarch_addr_bit (gdbarch) <= 32 ? 8 : 16;
printf_filtered ("\t`%ps', ", gdb_printf ("\t`%ps', ",
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
bfd_get_filename (abfd))); bfd_get_filename (abfd)));
gdb_stdout->wrap_here (8); gdb_stdout->wrap_here (8);
printf_filtered (_("file type %s.\n"), bfd_get_target (abfd)); gdb_printf (_("file type %s.\n"), bfd_get_target (abfd));
if (abfd == current_program_space->exec_bfd ()) if (abfd == current_program_space->exec_bfd ())
{ {
/* gcc-3.4 does not like the initialization in /* gcc-3.4 does not like the initialization in
@ -944,16 +944,16 @@ print_section_info (const target_section_table *t, bfd *abfd)
entry_point = gdbarch_addr_bits_remove (gdbarch, entry_point = gdbarch_addr_bits_remove (gdbarch,
bfd_get_start_address (abfd) bfd_get_start_address (abfd)
+ displacement); + displacement);
printf_filtered (_("\tEntry point: %s\n"), gdb_printf (_("\tEntry point: %s\n"),
paddress (gdbarch, entry_point)); paddress (gdbarch, entry_point));
} }
for (const target_section &p : *t) for (const target_section &p : *t)
{ {
struct bfd_section *psect = p.the_bfd_section; struct bfd_section *psect = p.the_bfd_section;
bfd *pbfd = psect->owner; bfd *pbfd = psect->owner;
printf_filtered ("\t%s", hex_string_custom (p.addr, wid)); gdb_printf ("\t%s", hex_string_custom (p.addr, wid));
printf_filtered (" - %s", hex_string_custom (p.endaddr, wid)); gdb_printf (" - %s", hex_string_custom (p.endaddr, wid));
/* FIXME: A format of "08l" is not wide enough for file offsets /* FIXME: A format of "08l" is not wide enough for file offsets
larger than 4GB. OTOH, making it "016l" isn't desirable either larger than 4GB. OTOH, making it "016l" isn't desirable either
@ -962,14 +962,14 @@ print_section_info (const target_section_table *t, bfd *abfd)
format string accordingly. */ format string accordingly. */
/* FIXME: i18n: Need to rewrite this sentence. */ /* FIXME: i18n: Need to rewrite this sentence. */
if (info_verbose) if (info_verbose)
printf_filtered (" @ %s", gdb_printf (" @ %s",
hex_string_custom (psect->filepos, 8)); hex_string_custom (psect->filepos, 8));
printf_filtered (" is %s", bfd_section_name (psect)); gdb_printf (" is %s", bfd_section_name (psect));
if (pbfd != abfd) if (pbfd != abfd)
printf_filtered (" in %ps", gdb_printf (" in %ps",
styled_string (file_name_style.style (), styled_string (file_name_style.style (),
bfd_get_filename (pbfd))); bfd_get_filename (pbfd)));
printf_filtered ("\n"); gdb_printf ("\n");
} }
} }

View file

@ -346,7 +346,7 @@ void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
const std::vector<T> &vals) const std::vector<T> &vals)
{ {
fprintf_filtered (stream, _("%*sVector:\n"), depth, ""); gdb_printf (stream, _("%*sVector:\n"), depth, "");
for (auto &item : vals) for (auto &item : vals)
dump_for_expression (stream, depth + 1, item); dump_for_expression (stream, depth + 1, item);
} }

View file

@ -71,63 +71,63 @@ namespace expr
void void
dump_for_expression (struct ui_file *stream, int depth, enum exp_opcode op) dump_for_expression (struct ui_file *stream, int depth, enum exp_opcode op)
{ {
fprintf_filtered (stream, _("%*sOperation: %s\n"), depth, "", op_name (op)); gdb_printf (stream, _("%*sOperation: %s\n"), depth, "", op_name (op));
} }
void void
dump_for_expression (struct ui_file *stream, int depth, const std::string &str) dump_for_expression (struct ui_file *stream, int depth, const std::string &str)
{ {
fprintf_filtered (stream, _("%*sString: %s\n"), depth, "", str.c_str ()); gdb_printf (stream, _("%*sString: %s\n"), depth, "", str.c_str ());
} }
void void
dump_for_expression (struct ui_file *stream, int depth, struct type *type) dump_for_expression (struct ui_file *stream, int depth, struct type *type)
{ {
fprintf_filtered (stream, _("%*sType: "), depth, ""); gdb_printf (stream, _("%*sType: "), depth, "");
type_print (type, nullptr, stream, 0); type_print (type, nullptr, stream, 0);
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
} }
void void
dump_for_expression (struct ui_file *stream, int depth, CORE_ADDR addr) dump_for_expression (struct ui_file *stream, int depth, CORE_ADDR addr)
{ {
fprintf_filtered (stream, _("%*sConstant: %s\n"), depth, "", gdb_printf (stream, _("%*sConstant: %s\n"), depth, "",
core_addr_to_string (addr)); core_addr_to_string (addr));
} }
void void
dump_for_expression (struct ui_file *stream, int depth, internalvar *ivar) dump_for_expression (struct ui_file *stream, int depth, internalvar *ivar)
{ {
fprintf_filtered (stream, _("%*sInternalvar: $%s\n"), depth, "", gdb_printf (stream, _("%*sInternalvar: $%s\n"), depth, "",
internalvar_name (ivar)); internalvar_name (ivar));
} }
void void
dump_for_expression (struct ui_file *stream, int depth, symbol *sym) dump_for_expression (struct ui_file *stream, int depth, symbol *sym)
{ {
fprintf_filtered (stream, _("%*sSymbol: %s\n"), depth, "", gdb_printf (stream, _("%*sSymbol: %s\n"), depth, "",
sym->print_name ()); sym->print_name ());
} }
void void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
bound_minimal_symbol msym) bound_minimal_symbol msym)
{ {
fprintf_filtered (stream, _("%*sMinsym %s in objfile %s\n"), depth, "", gdb_printf (stream, _("%*sMinsym %s in objfile %s\n"), depth, "",
msym.minsym->print_name (), objfile_name (msym.objfile)); msym.minsym->print_name (), objfile_name (msym.objfile));
} }
void void
dump_for_expression (struct ui_file *stream, int depth, const block *bl) dump_for_expression (struct ui_file *stream, int depth, const block *bl)
{ {
fprintf_filtered (stream, _("%*sBlock: %p\n"), depth, "", bl); gdb_printf (stream, _("%*sBlock: %p\n"), depth, "", bl);
} }
void void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
const block_symbol &sym) const block_symbol &sym)
{ {
fprintf_filtered (stream, _("%*sBlock symbol:\n"), depth, ""); gdb_printf (stream, _("%*sBlock symbol:\n"), depth, "");
dump_for_expression (stream, depth + 1, sym.symbol); dump_for_expression (stream, depth + 1, sym.symbol);
dump_for_expression (stream, depth + 1, sym.block); dump_for_expression (stream, depth + 1, sym.block);
} }
@ -136,19 +136,19 @@ void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
type_instance_flags flags) type_instance_flags flags)
{ {
fprintf_filtered (stream, _("%*sType flags: "), depth, ""); gdb_printf (stream, _("%*sType flags: "), depth, "");
if (flags & TYPE_INSTANCE_FLAG_CONST) if (flags & TYPE_INSTANCE_FLAG_CONST)
gdb_puts ("const ", stream); gdb_puts ("const ", stream);
if (flags & TYPE_INSTANCE_FLAG_VOLATILE) if (flags & TYPE_INSTANCE_FLAG_VOLATILE)
gdb_puts ("volatile", stream); gdb_puts ("volatile", stream);
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
} }
void void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
enum c_string_type_values flags) enum c_string_type_values flags)
{ {
fprintf_filtered (stream, _("%*sC string flags: "), depth, ""); gdb_printf (stream, _("%*sC string flags: "), depth, "");
switch (flags & ~C_CHAR) switch (flags & ~C_CHAR)
{ {
case C_WIDE_STRING: case C_WIDE_STRING:
@ -176,7 +176,7 @@ void
dump_for_expression (struct ui_file *stream, int depth, dump_for_expression (struct ui_file *stream, int depth,
enum range_flag flags) enum range_flag flags)
{ {
fprintf_filtered (stream, _("%*sRange:"), depth, ""); gdb_printf (stream, _("%*sRange:"), depth, "");
if ((flags & RANGE_LOW_BOUND_DEFAULT) != 0) if ((flags & RANGE_LOW_BOUND_DEFAULT) != 0)
gdb_puts (_("low-default "), stream); gdb_puts (_("low-default "), stream);
if ((flags & RANGE_HIGH_BOUND_DEFAULT) != 0) if ((flags & RANGE_HIGH_BOUND_DEFAULT) != 0)
@ -185,7 +185,7 @@ dump_for_expression (struct ui_file *stream, int depth,
gdb_puts (_("high-exclusive "), stream); gdb_puts (_("high-exclusive "), stream);
if ((flags & RANGE_HAS_STRIDE) != 0) if ((flags & RANGE_HAS_STRIDE) != 0)
gdb_puts (_("has-stride"), stream); gdb_puts (_("has-stride"), stream);
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
} }
void void
@ -198,9 +198,9 @@ dump_for_expression (struct ui_file *stream, int depth,
void void
float_const_operation::dump (struct ui_file *stream, int depth) const float_const_operation::dump (struct ui_file *stream, int depth) const
{ {
fprintf_filtered (stream, _("%*sFloat: "), depth, ""); gdb_printf (stream, _("%*sFloat: "), depth, "");
print_floating (m_data.data (), m_type, stream); print_floating (m_data.data (), m_type, stream);
fprintf_filtered (stream, "\n"); gdb_printf (stream, "\n");
} }
} /* namespace expr */ } /* namespace expr */

View file

@ -50,8 +50,8 @@ static void
show_repack_array_slices (struct ui_file *file, int from_tty, show_repack_array_slices (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Repacking of Fortran array slices is %s.\n"), gdb_printf (file, _("Repacking of Fortran array slices is %s.\n"),
value); value);
} }
/* Debugging of Fortran's array slicing. */ /* Debugging of Fortran's array slicing. */
@ -63,8 +63,8 @@ show_fortran_array_slicing_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, _("Debugging of Fortran array slicing is %s.\n"), gdb_printf (file, _("Debugging of Fortran array slicing is %s.\n"),
value); value);
} }
/* Local functions */ /* Local functions */
@ -1541,9 +1541,9 @@ f_language::print_array_index (struct type *index_type, LONGEST index,
{ {
struct value *index_value = value_from_longest (index_type, index); struct value *index_value = value_from_longest (index_type, index);
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
value_print (index_value, stream, options); value_print (index_value, stream, options);
fprintf_filtered (stream, ") = "); gdb_printf (stream, ") = ");
} }
/* See language.h. */ /* See language.h. */

View file

@ -111,7 +111,7 @@ f_language::f_type_print_varspec_prefix (struct type *type,
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
f_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0); f_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
break; break;
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
@ -169,7 +169,7 @@ f_language::f_type_print_varspec_suffix (struct type *type,
arrayprint_recurse_level++; arrayprint_recurse_level++;
if (arrayprint_recurse_level == 1) if (arrayprint_recurse_level == 1)
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
if (type_not_associated (type)) if (type_not_associated (type))
print_rank_only = true; print_rank_only = true;
@ -193,18 +193,18 @@ f_language::f_type_print_varspec_suffix (struct type *type,
print_rank_only); print_rank_only);
if (print_rank_only) if (print_rank_only)
fprintf_filtered (stream, ":"); gdb_printf (stream, ":");
else else
{ {
LONGEST lower_bound = f77_get_lowerbound (type); LONGEST lower_bound = f77_get_lowerbound (type);
if (lower_bound != 1) /* Not the default. */ if (lower_bound != 1) /* Not the default. */
fprintf_filtered (stream, "%s:", plongest (lower_bound)); gdb_printf (stream, "%s:", plongest (lower_bound));
/* Make sure that, if we have an assumed size array, we /* Make sure that, if we have an assumed size array, we
print out a warning and print the upperbound as '*'. */ print out a warning and print the upperbound as '*'. */
if (type->bounds ()->high.kind () == PROP_UNDEFINED) if (type->bounds ()->high.kind () == PROP_UNDEFINED)
fprintf_filtered (stream, "*"); gdb_printf (stream, "*");
else else
{ {
LONGEST upper_bound = f77_get_upperbound (type); LONGEST upper_bound = f77_get_upperbound (type);
@ -219,9 +219,9 @@ f_language::f_type_print_varspec_suffix (struct type *type,
print_rank_only); print_rank_only);
if (arrayprint_recurse_level == 1) if (arrayprint_recurse_level == 1)
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
else else
fprintf_filtered (stream, ","); gdb_printf (stream, ",");
arrayprint_recurse_level--; arrayprint_recurse_level--;
break; break;
@ -229,7 +229,7 @@ f_language::f_type_print_varspec_suffix (struct type *type,
case TYPE_CODE_REF: case TYPE_CODE_REF:
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0, f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
arrayprint_recurse_level, false); arrayprint_recurse_level, false);
fprintf_filtered (stream, " )"); gdb_printf (stream, " )");
break; break;
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
@ -240,8 +240,8 @@ f_language::f_type_print_varspec_suffix (struct type *type,
passed_a_ptr, 0, passed_a_ptr, 0,
arrayprint_recurse_level, false); arrayprint_recurse_level, false);
if (passed_a_ptr) if (passed_a_ptr)
fprintf_filtered (stream, ") "); gdb_printf (stream, ") ");
fprintf_filtered (stream, "("); gdb_printf (stream, "(");
if (nfields == 0 && type->is_prototyped ()) if (nfields == 0 && type->is_prototyped ())
print_type (builtin_f_type (type->arch ())->builtin_void, print_type (builtin_f_type (type->arch ())->builtin_void,
"", stream, -1, 0, 0); "", stream, -1, 0, 0);
@ -255,7 +255,7 @@ f_language::f_type_print_varspec_suffix (struct type *type,
} }
print_type (type->field (i).type (), "", stream, -1, 0, 0); print_type (type->field (i).type (), "", stream, -1, 0, 0);
} }
fprintf_filtered (stream, ")"); gdb_printf (stream, ")");
} }
break; break;
@ -310,7 +310,7 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
else if (type->code () == TYPE_CODE_STRUCT else if (type->code () == TYPE_CODE_STRUCT
|| type->code () == TYPE_CODE_NAMELIST) || type->code () == TYPE_CODE_NAMELIST)
prefix = "Type "; prefix = "Type ";
fprintf_filtered (stream, "%*s%s%s", level, "", prefix, type->name ()); gdb_printf (stream, "%*s%s%s", level, "", prefix, type->name ());
return; return;
} }
@ -334,33 +334,33 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
break; break;
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
fprintf_filtered (stream, "%*sPTR TO -> ( ", level, ""); gdb_printf (stream, "%*sPTR TO -> ( ", level, "");
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0); f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
break; break;
case TYPE_CODE_REF: case TYPE_CODE_REF:
fprintf_filtered (stream, "%*sREF TO -> ( ", level, ""); gdb_printf (stream, "%*sREF TO -> ( ", level, "");
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0); f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
break; break;
case TYPE_CODE_VOID: case TYPE_CODE_VOID:
{ {
struct type *void_type = builtin_f_type (type->arch ())->builtin_void; struct type *void_type = builtin_f_type (type->arch ())->builtin_void;
fprintf_filtered (stream, "%*s%s", level, "", void_type->name ()); gdb_printf (stream, "%*s%s", level, "", void_type->name ());
} }
break; break;
case TYPE_CODE_UNDEF: case TYPE_CODE_UNDEF:
fprintf_filtered (stream, "%*sstruct <unknown>", level, ""); gdb_printf (stream, "%*sstruct <unknown>", level, "");
break; break;
case TYPE_CODE_ERROR: case TYPE_CODE_ERROR:
fprintf_filtered (stream, "%*s%s", level, "", TYPE_ERROR_NAME (type)); gdb_printf (stream, "%*s%s", level, "", TYPE_ERROR_NAME (type));
break; break;
case TYPE_CODE_RANGE: case TYPE_CODE_RANGE:
/* This should not occur. */ /* This should not occur. */
fprintf_filtered (stream, "%*s<range type>", level, ""); gdb_printf (stream, "%*s<range type>", level, "");
break; break;
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
@ -370,7 +370,7 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
C-oriented, we must change these to "character" from "char". */ C-oriented, we must change these to "character" from "char". */
if (strcmp (type->name (), "char") == 0) if (strcmp (type->name (), "char") == 0)
fprintf_filtered (stream, "%*scharacter", level, ""); gdb_printf (stream, "%*scharacter", level, "");
else else
goto default_case; goto default_case;
break; break;
@ -386,19 +386,19 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
{ {
LONGEST upper_bound = f77_get_upperbound (type); LONGEST upper_bound = f77_get_upperbound (type);
fprintf_filtered (stream, "character*%s", pulongest (upper_bound)); gdb_printf (stream, "character*%s", pulongest (upper_bound));
} }
else else
fprintf_filtered (stream, "%*scharacter*(*)", level, ""); gdb_printf (stream, "%*scharacter*(*)", level, "");
break; break;
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
case TYPE_CODE_NAMELIST: case TYPE_CODE_NAMELIST:
if (type->code () == TYPE_CODE_UNION) if (type->code () == TYPE_CODE_UNION)
fprintf_filtered (stream, "%*sType, C_Union :: ", level, ""); gdb_printf (stream, "%*sType, C_Union :: ", level, "");
else else
fprintf_filtered (stream, "%*sType ", level, ""); gdb_printf (stream, "%*sType ", level, "");
gdb_puts (type->name (), stream); gdb_puts (type->name (), stream);
/* According to the definition, /* According to the definition,
we only print structure elements in case show > 0. */ we only print structure elements in case show > 0. */
@ -416,13 +416,13 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
stream, show - 1, 0, 0, 0, false); stream, show - 1, 0, 0, 0, false);
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
} }
fprintf_filtered (stream, "%*sEnd Type ", level, ""); gdb_printf (stream, "%*sEnd Type ", level, "");
gdb_puts (type->name (), stream); gdb_puts (type->name (), stream);
} }
break; break;
case TYPE_CODE_MODULE: case TYPE_CODE_MODULE:
fprintf_filtered (stream, "%*smodule %s", level, "", type->name ()); gdb_printf (stream, "%*smodule %s", level, "", type->name ());
break; break;
default_case: default_case:
@ -432,12 +432,12 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
the type name is, as recorded in the type itself. If there the type name is, as recorded in the type itself. If there
is no type name, then complain. */ is no type name, then complain. */
if (type->name () != NULL) if (type->name () != NULL)
fprintf_filtered (stream, "%*s%s", level, "", type->name ()); gdb_printf (stream, "%*s%s", level, "", type->name ());
else else
error (_("Invalid type code (%d) in symbol table."), type->code ()); error (_("Invalid type code (%d) in symbol table."), type->code ());
break; break;
} }
if (TYPE_IS_ALLOCATABLE (type)) if (TYPE_IS_ALLOCATABLE (type))
fprintf_filtered (stream, ", allocatable"); gdb_printf (stream, ", allocatable");
} }

View file

@ -212,10 +212,10 @@ public:
if (nrepeats >= m_options->repeat_count_threshold) if (nrepeats >= m_options->repeat_count_threshold)
{ {
annotate_elt_rep (nrepeats + 1); annotate_elt_rep (nrepeats + 1);
fprintf_filtered (m_stream, "%p[<repeats %s times>%p]", gdb_printf (m_stream, "%p[<repeats %s times>%p]",
metadata_style.style ().ptr (), metadata_style.style ().ptr (),
plongest (nrepeats + 1), plongest (nrepeats + 1),
nullptr); nullptr);
annotate_elt_rep_end (); annotate_elt_rep_end ();
if (!repeated) if (!repeated)
gdb_puts (" ", m_stream); gdb_puts (" ", m_stream);
@ -281,10 +281,10 @@ public:
if (nrepeats >= m_options->repeat_count_threshold) if (nrepeats >= m_options->repeat_count_threshold)
{ {
annotate_elt_rep (nrepeats + 1); annotate_elt_rep (nrepeats + 1);
fprintf_filtered (m_stream, "%p[<repeats %s times>%p]", gdb_printf (m_stream, "%p[<repeats %s times>%p]",
metadata_style.style ().ptr (), metadata_style.style ().ptr (),
plongest (nrepeats + 1), plongest (nrepeats + 1),
nullptr); nullptr);
annotate_elt_rep_end (); annotate_elt_rep_end ();
} }
else else
@ -515,7 +515,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
case TYPE_CODE_NAMELIST: case TYPE_CODE_NAMELIST:
/* Starting from the Fortran 90 standard, Fortran supports derived /* Starting from the Fortran 90 standard, Fortran supports derived
types. */ types. */
fprintf_filtered (stream, "( "); gdb_printf (stream, "( ");
for (index = 0; index < type->num_fields (); index++) for (index = 0; index < type->num_fields (); index++)
{ {
struct type *field_type struct type *field_type
@ -557,7 +557,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
++printed_field; ++printed_field;
} }
} }
fprintf_filtered (stream, " )"); gdb_printf (stream, " )");
break; break;
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
@ -625,17 +625,17 @@ info_common_command_for_block (const struct block *block, const char *comname,
else else
*any_printed = 1; *any_printed = 1;
if (sym->print_name ()) if (sym->print_name ())
printf_filtered (_("Contents of F77 COMMON block '%s':\n"), gdb_printf (_("Contents of F77 COMMON block '%s':\n"),
sym->print_name ()); sym->print_name ());
else else
printf_filtered (_("Contents of blank COMMON block:\n")); gdb_printf (_("Contents of blank COMMON block:\n"));
for (index = 0; index < common->n_entries; index++) for (index = 0; index < common->n_entries; index++)
{ {
struct value *val = NULL; struct value *val = NULL;
printf_filtered ("%s = ", gdb_printf ("%s = ",
common->contents[index]->print_name ()); common->contents[index]->print_name ());
try try
{ {
@ -679,7 +679,7 @@ info_common_command (const char *comname, int from_tty)
block = get_frame_block (fi, 0); block = get_frame_block (fi, 0);
if (block == NULL) if (block == NULL)
{ {
printf_filtered (_("No symbol table info available.\n")); gdb_printf (_("No symbol table info available.\n"));
return; return;
} }
@ -696,9 +696,9 @@ info_common_command (const char *comname, int from_tty)
if (!values_printed) if (!values_printed)
{ {
if (comname) if (comname)
printf_filtered (_("No common block '%s'.\n"), comname); gdb_printf (_("No common block '%s'.\n"), comname);
else else
printf_filtered (_("No common blocks.\n")); gdb_printf (_("No common blocks.\n"));
} }
} }

View file

@ -108,12 +108,12 @@ fbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
size = kve->kve_end - kve->kve_start; size = kve->kve_end - kve->kve_start;
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n", gdb_printf ("Save segment, %ld bytes at %s (%c%c%c)\n",
(long) size, (long) size,
paddress (target_gdbarch (), kve->kve_start), paddress (target_gdbarch (), kve->kve_start),
kve->kve_protection & KVME_PROT_READ ? 'r' : '-', kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-', kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-'); kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
} }
/* Invoke the callback function to create the corefile segment. /* Invoke the callback function to create the corefile segment.
@ -241,7 +241,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
else else
error (_("Invalid arguments.")); error (_("Invalid arguments."));
printf_filtered (_("process %d\n"), pid); gdb_printf (_("process %d\n"), pid);
if (do_cwd || do_exe || do_files) if (do_cwd || do_exe || do_files)
fdtbl.reset (kinfo_getfile (pid, &nfd)); fdtbl.reset (kinfo_getfile (pid, &nfd));
@ -249,7 +249,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
{ {
gdb::unique_xmalloc_ptr<char> cmdline = fbsd_fetch_cmdline (pid); gdb::unique_xmalloc_ptr<char> cmdline = fbsd_fetch_cmdline (pid);
if (cmdline != nullptr) if (cmdline != nullptr)
printf_filtered ("cmdline = '%s'\n", cmdline.get ()); gdb_printf ("cmdline = '%s'\n", cmdline.get ());
else else
warning (_("unable to fetch command line")); warning (_("unable to fetch command line"));
} }
@ -266,7 +266,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
} }
} }
if (cwd != NULL) if (cwd != NULL)
printf_filtered ("cwd = '%s'\n", cwd); gdb_printf ("cwd = '%s'\n", cwd);
else else
warning (_("unable to fetch current working directory")); warning (_("unable to fetch current working directory"));
} }
@ -285,7 +285,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
if (exe == NULL) if (exe == NULL)
exe = pid_to_exec_file (pid); exe = pid_to_exec_file (pid);
if (exe != NULL) if (exe != NULL)
printf_filtered ("exe = '%s'\n", exe); gdb_printf ("exe = '%s'\n", exe);
else else
warning (_("unable to fetch executable path name")); warning (_("unable to fetch executable path name"));
} }
@ -336,7 +336,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
const char *state; const char *state;
int pgtok; int pgtok;
printf_filtered ("Name: %s\n", kp.ki_comm); gdb_printf ("Name: %s\n", kp.ki_comm);
switch (kp.ki_stat) switch (kp.ki_stat)
{ {
case SIDL: case SIDL:
@ -364,69 +364,69 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
state = "? (unknown)"; state = "? (unknown)";
break; break;
} }
printf_filtered ("State: %s\n", state); gdb_printf ("State: %s\n", state);
printf_filtered ("Parent process: %d\n", kp.ki_ppid); gdb_printf ("Parent process: %d\n", kp.ki_ppid);
printf_filtered ("Process group: %d\n", kp.ki_pgid); gdb_printf ("Process group: %d\n", kp.ki_pgid);
printf_filtered ("Session id: %d\n", kp.ki_sid); gdb_printf ("Session id: %d\n", kp.ki_sid);
printf_filtered ("TTY: %s\n", pulongest (kp.ki_tdev)); gdb_printf ("TTY: %s\n", pulongest (kp.ki_tdev));
printf_filtered ("TTY owner process group: %d\n", kp.ki_tpgid); gdb_printf ("TTY owner process group: %d\n", kp.ki_tpgid);
printf_filtered ("User IDs (real, effective, saved): %d %d %d\n", gdb_printf ("User IDs (real, effective, saved): %d %d %d\n",
kp.ki_ruid, kp.ki_uid, kp.ki_svuid); kp.ki_ruid, kp.ki_uid, kp.ki_svuid);
printf_filtered ("Group IDs (real, effective, saved): %d %d %d\n", gdb_printf ("Group IDs (real, effective, saved): %d %d %d\n",
kp.ki_rgid, kp.ki_groups[0], kp.ki_svgid); kp.ki_rgid, kp.ki_groups[0], kp.ki_svgid);
printf_filtered ("Groups: "); gdb_printf ("Groups: ");
for (int i = 0; i < kp.ki_ngroups; i++) for (int i = 0; i < kp.ki_ngroups; i++)
printf_filtered ("%d ", kp.ki_groups[i]); gdb_printf ("%d ", kp.ki_groups[i]);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered ("Minor faults (no memory page): %ld\n", gdb_printf ("Minor faults (no memory page): %ld\n",
kp.ki_rusage.ru_minflt); kp.ki_rusage.ru_minflt);
printf_filtered ("Minor faults, children: %ld\n", gdb_printf ("Minor faults, children: %ld\n",
kp.ki_rusage_ch.ru_minflt); kp.ki_rusage_ch.ru_minflt);
printf_filtered ("Major faults (memory page faults): %ld\n", gdb_printf ("Major faults (memory page faults): %ld\n",
kp.ki_rusage.ru_majflt); kp.ki_rusage.ru_majflt);
printf_filtered ("Major faults, children: %ld\n", gdb_printf ("Major faults, children: %ld\n",
kp.ki_rusage_ch.ru_majflt); kp.ki_rusage_ch.ru_majflt);
printf_filtered ("utime: %s.%06ld\n", gdb_printf ("utime: %s.%06ld\n",
plongest (kp.ki_rusage.ru_utime.tv_sec), plongest (kp.ki_rusage.ru_utime.tv_sec),
kp.ki_rusage.ru_utime.tv_usec); kp.ki_rusage.ru_utime.tv_usec);
printf_filtered ("stime: %s.%06ld\n", gdb_printf ("stime: %s.%06ld\n",
plongest (kp.ki_rusage.ru_stime.tv_sec), plongest (kp.ki_rusage.ru_stime.tv_sec),
kp.ki_rusage.ru_stime.tv_usec); kp.ki_rusage.ru_stime.tv_usec);
printf_filtered ("utime, children: %s.%06ld\n", gdb_printf ("utime, children: %s.%06ld\n",
plongest (kp.ki_rusage_ch.ru_utime.tv_sec), plongest (kp.ki_rusage_ch.ru_utime.tv_sec),
kp.ki_rusage_ch.ru_utime.tv_usec); kp.ki_rusage_ch.ru_utime.tv_usec);
printf_filtered ("stime, children: %s.%06ld\n", gdb_printf ("stime, children: %s.%06ld\n",
plongest (kp.ki_rusage_ch.ru_stime.tv_sec), plongest (kp.ki_rusage_ch.ru_stime.tv_sec),
kp.ki_rusage_ch.ru_stime.tv_usec); kp.ki_rusage_ch.ru_stime.tv_usec);
printf_filtered ("'nice' value: %d\n", kp.ki_nice); gdb_printf ("'nice' value: %d\n", kp.ki_nice);
printf_filtered ("Start time: %s.%06ld\n", gdb_printf ("Start time: %s.%06ld\n",
plongest (kp.ki_start.tv_sec), plongest (kp.ki_start.tv_sec),
kp.ki_start.tv_usec); kp.ki_start.tv_usec);
pgtok = getpagesize () / 1024; pgtok = getpagesize () / 1024;
printf_filtered ("Virtual memory size: %s kB\n", gdb_printf ("Virtual memory size: %s kB\n",
pulongest (kp.ki_size / 1024)); pulongest (kp.ki_size / 1024));
printf_filtered ("Data size: %s kB\n", gdb_printf ("Data size: %s kB\n",
pulongest (kp.ki_dsize * pgtok)); pulongest (kp.ki_dsize * pgtok));
printf_filtered ("Stack size: %s kB\n", gdb_printf ("Stack size: %s kB\n",
pulongest (kp.ki_ssize * pgtok)); pulongest (kp.ki_ssize * pgtok));
printf_filtered ("Text size: %s kB\n", gdb_printf ("Text size: %s kB\n",
pulongest (kp.ki_tsize * pgtok)); pulongest (kp.ki_tsize * pgtok));
printf_filtered ("Resident set size: %s kB\n", gdb_printf ("Resident set size: %s kB\n",
pulongest (kp.ki_rssize * pgtok)); pulongest (kp.ki_rssize * pgtok));
printf_filtered ("Maximum RSS: %s kB\n", gdb_printf ("Maximum RSS: %s kB\n",
pulongest (kp.ki_rusage.ru_maxrss)); pulongest (kp.ki_rusage.ru_maxrss));
printf_filtered ("Pending Signals: "); gdb_printf ("Pending Signals: ");
for (int i = 0; i < _SIG_WORDS; i++) for (int i = 0; i < _SIG_WORDS; i++)
printf_filtered ("%08x ", kp.ki_siglist.__bits[i]); gdb_printf ("%08x ", kp.ki_siglist.__bits[i]);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered ("Ignored Signals: "); gdb_printf ("Ignored Signals: ");
for (int i = 0; i < _SIG_WORDS; i++) for (int i = 0; i < _SIG_WORDS; i++)
printf_filtered ("%08x ", kp.ki_sigignore.__bits[i]); gdb_printf ("%08x ", kp.ki_sigignore.__bits[i]);
printf_filtered ("\n"); gdb_printf ("\n");
printf_filtered ("Caught Signals: "); gdb_printf ("Caught Signals: ");
for (int i = 0; i < _SIG_WORDS; i++) for (int i = 0; i < _SIG_WORDS; i++)
printf_filtered ("%08x ", kp.ki_sigcatch.__bits[i]); gdb_printf ("%08x ", kp.ki_sigcatch.__bits[i]);
printf_filtered ("\n"); gdb_printf ("\n");
} }
} }
@ -717,15 +717,15 @@ static void
show_fbsd_lwp_debug (struct ui_file *file, int from_tty, show_fbsd_lwp_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging of FreeBSD lwp module is %s.\n"), value); gdb_printf (file, _("Debugging of FreeBSD lwp module is %s.\n"), value);
} }
static void static void
show_fbsd_nat_debug (struct ui_file *file, int from_tty, show_fbsd_nat_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging of FreeBSD native target is %s.\n"), gdb_printf (file, _("Debugging of FreeBSD native target is %s.\n"),
value); value);
} }
#define fbsd_lwp_debug_printf(fmt, ...) \ #define fbsd_lwp_debug_printf(fmt, ...) \
@ -1296,8 +1296,8 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
fbsd_lwp_debug_printf ("deleting thread for LWP %u", fbsd_lwp_debug_printf ("deleting thread for LWP %u",
pl.pl_lwpid); pl.pl_lwpid);
if (print_thread_events) if (print_thread_events)
printf_filtered (_("[%s exited]\n"), gdb_printf (_("[%s exited]\n"),
target_pid_to_str (wptid).c_str ()); target_pid_to_str (wptid).c_str ());
low_delete_thread (thr); low_delete_thread (thr);
delete_thread (thr); delete_thread (thr);
} }

View file

@ -921,8 +921,8 @@ fbsd_print_sockaddr_in (const void *sockaddr)
if (inet_ntop (AF_INET, sin->sin_addr, buf, sizeof buf) == nullptr) if (inet_ntop (AF_INET, sin->sin_addr, buf, sizeof buf) == nullptr)
error (_("Failed to format IPv4 address")); error (_("Failed to format IPv4 address"));
printf_filtered ("%s:%u", buf, gdb_printf ("%s:%u", buf,
(sin->sin_port[0] << 8) | sin->sin_port[1]); (sin->sin_port[0] << 8) | sin->sin_port[1]);
} }
/* Helper function to print out an IPv6 socket address. */ /* Helper function to print out an IPv6 socket address. */
@ -936,8 +936,8 @@ fbsd_print_sockaddr_in6 (const void *sockaddr)
if (inet_ntop (AF_INET6, sin6->sin6_addr, buf, sizeof buf) == nullptr) if (inet_ntop (AF_INET6, sin6->sin6_addr, buf, sizeof buf) == nullptr)
error (_("Failed to format IPv6 address")); error (_("Failed to format IPv6 address"));
printf_filtered ("%s.%u", buf, gdb_printf ("%s.%u", buf,
(sin6->sin6_port[0] << 8) | sin6->sin6_port[1]); (sin6->sin6_port[0] << 8) | sin6->sin6_port[1]);
} }
/* See fbsd-tdep.h. */ /* See fbsd-tdep.h. */
@ -945,9 +945,9 @@ fbsd_print_sockaddr_in6 (const void *sockaddr)
void void
fbsd_info_proc_files_header () fbsd_info_proc_files_header ()
{ {
printf_filtered (_("Open files:\n\n")); gdb_printf (_("Open files:\n\n"));
printf_filtered (" %6s %6s %10s %9s %s\n", gdb_printf (" %6s %6s %10s %9s %s\n",
"FD", "Type", "Offset", "Flags ", "Name"); "FD", "Type", "Offset", "Flags ", "Name");
} }
/* See fbsd-tdep.h. */ /* See fbsd-tdep.h. */
@ -959,11 +959,11 @@ fbsd_info_proc_files_entry (int kf_type, int kf_fd, int kf_flags,
int kf_sock_protocol, const void *kf_sa_local, int kf_sock_protocol, const void *kf_sa_local,
const void *kf_sa_peer, const void *kf_path) const void *kf_sa_peer, const void *kf_path)
{ {
printf_filtered (" %6s %6s %10s %8s ", gdb_printf (" %6s %6s %10s %8s ",
fbsd_file_fd (kf_fd), fbsd_file_fd (kf_fd),
fbsd_file_type (kf_type, kf_vnode_type), fbsd_file_type (kf_type, kf_vnode_type),
kf_offset > -1 ? hex_string (kf_offset) : "-", kf_offset > -1 ? hex_string (kf_offset) : "-",
fbsd_file_flags (kf_flags)); fbsd_file_flags (kf_flags));
if (kf_type == KINFO_FILE_TYPE_SOCKET) if (kf_type == KINFO_FILE_TYPE_SOCKET)
{ {
switch (kf_sock_domain) switch (kf_sock_domain)
@ -973,16 +973,16 @@ fbsd_info_proc_files_entry (int kf_type, int kf_fd, int kf_flags,
switch (kf_sock_type) switch (kf_sock_type)
{ {
case FBSD_SOCK_STREAM: case FBSD_SOCK_STREAM:
printf_filtered ("unix stream:"); gdb_printf ("unix stream:");
break; break;
case FBSD_SOCK_DGRAM: case FBSD_SOCK_DGRAM:
printf_filtered ("unix dgram:"); gdb_printf ("unix dgram:");
break; break;
case FBSD_SOCK_SEQPACKET: case FBSD_SOCK_SEQPACKET:
printf_filtered ("unix seqpacket:"); gdb_printf ("unix seqpacket:");
break; break;
default: default:
printf_filtered ("unix <%d>:", kf_sock_type); gdb_printf ("unix <%d>:", kf_sock_type);
break; break;
} }
@ -993,26 +993,26 @@ fbsd_info_proc_files_entry (int kf_type, int kf_fd, int kf_flags,
if (saddr_un->sun_path[0] == 0) if (saddr_un->sun_path[0] == 0)
saddr_un = reinterpret_cast<const struct fbsd_sockaddr_un *> saddr_un = reinterpret_cast<const struct fbsd_sockaddr_un *>
(kf_sa_peer); (kf_sa_peer);
printf_filtered ("%s", saddr_un->sun_path); gdb_printf ("%s", saddr_un->sun_path);
break; break;
} }
case FBSD_AF_INET: case FBSD_AF_INET:
printf_filtered ("%s4 ", fbsd_ipproto (kf_sock_protocol)); gdb_printf ("%s4 ", fbsd_ipproto (kf_sock_protocol));
fbsd_print_sockaddr_in (kf_sa_local); fbsd_print_sockaddr_in (kf_sa_local);
printf_filtered (" -> "); gdb_printf (" -> ");
fbsd_print_sockaddr_in (kf_sa_peer); fbsd_print_sockaddr_in (kf_sa_peer);
break; break;
case FBSD_AF_INET6: case FBSD_AF_INET6:
printf_filtered ("%s6 ", fbsd_ipproto (kf_sock_protocol)); gdb_printf ("%s6 ", fbsd_ipproto (kf_sock_protocol));
fbsd_print_sockaddr_in6 (kf_sa_local); fbsd_print_sockaddr_in6 (kf_sa_local);
printf_filtered (" -> "); gdb_printf (" -> ");
fbsd_print_sockaddr_in6 (kf_sa_peer); fbsd_print_sockaddr_in6 (kf_sa_peer);
break; break;
} }
} }
else else
printf_filtered ("%s", reinterpret_cast<const char *> (kf_path)); gdb_printf ("%s", reinterpret_cast<const char *> (kf_path));
printf_filtered ("\n"); gdb_printf ("\n");
} }
/* Implement "info proc files" for a corefile. */ /* Implement "info proc files" for a corefile. */
@ -1098,20 +1098,20 @@ fbsd_vm_map_entry_flags (int kve_flags, int kve_protection)
void void
fbsd_info_proc_mappings_header (int addr_bit) fbsd_info_proc_mappings_header (int addr_bit)
{ {
printf_filtered (_("Mapped address spaces:\n\n")); gdb_printf (_("Mapped address spaces:\n\n"));
if (addr_bit == 64) if (addr_bit == 64)
{ {
printf_filtered (" %18s %18s %10s %10s %9s %s\n", gdb_printf (" %18s %18s %10s %10s %9s %s\n",
"Start Addr", "Start Addr",
" End Addr", " End Addr",
" Size", " Offset", "Flags ", "File"); " Size", " Offset", "Flags ", "File");
} }
else else
{ {
printf_filtered ("\t%10s %10s %10s %10s %9s %s\n", gdb_printf ("\t%10s %10s %10s %10s %9s %s\n",
"Start Addr", "Start Addr",
" End Addr", " End Addr",
" Size", " Offset", "Flags ", "File"); " Size", " Offset", "Flags ", "File");
} }
} }
@ -1125,23 +1125,23 @@ fbsd_info_proc_mappings_entry (int addr_bit, ULONGEST kve_start,
{ {
if (addr_bit == 64) if (addr_bit == 64)
{ {
printf_filtered (" %18s %18s %10s %10s %9s %s\n", gdb_printf (" %18s %18s %10s %10s %9s %s\n",
hex_string (kve_start), hex_string (kve_start),
hex_string (kve_end), hex_string (kve_end),
hex_string (kve_end - kve_start), hex_string (kve_end - kve_start),
hex_string (kve_offset), hex_string (kve_offset),
fbsd_vm_map_entry_flags (kve_flags, kve_protection), fbsd_vm_map_entry_flags (kve_flags, kve_protection),
reinterpret_cast<const char *> (kve_path)); reinterpret_cast<const char *> (kve_path));
} }
else else
{ {
printf_filtered ("\t%10s %10s %10s %10s %9s %s\n", gdb_printf ("\t%10s %10s %10s %10s %9s %s\n",
hex_string (kve_start), hex_string (kve_start),
hex_string (kve_end), hex_string (kve_end),
hex_string (kve_end - kve_start), hex_string (kve_end - kve_start),
hex_string (kve_offset), hex_string (kve_offset),
fbsd_vm_map_entry_flags (kve_flags, kve_protection), fbsd_vm_map_entry_flags (kve_flags, kve_protection),
reinterpret_cast<const char *> (kve_path)); reinterpret_cast<const char *> (kve_path));
} }
} }
@ -1272,11 +1272,11 @@ fbsd_core_fetch_timeval (struct gdbarch *gdbarch, unsigned char *data,
static void static void
fbsd_print_sigset (const char *descr, unsigned char *sigset) fbsd_print_sigset (const char *descr, unsigned char *sigset)
{ {
printf_filtered ("%s: ", descr); gdb_printf ("%s: ", descr);
for (int i = 0; i < SIG_WORDS; i++) for (int i = 0; i < SIG_WORDS; i++)
printf_filtered ("%08x ", gdb_printf ("%08x ",
(unsigned int) bfd_get_32 (core_bfd, sigset + i * 4)); (unsigned int) bfd_get_32 (core_bfd, sigset + i * 4));
printf_filtered ("\n"); gdb_printf ("\n");
} }
/* Implement "info proc status" for a corefile. */ /* Implement "info proc status" for a corefile. */
@ -1336,15 +1336,15 @@ fbsd_core_info_proc_status (struct gdbarch *gdbarch)
return; return;
} }
printf_filtered ("Name: %.19s\n", descdata + kp->ki_comm); gdb_printf ("Name: %.19s\n", descdata + kp->ki_comm);
printf_filtered ("Process ID: %s\n", gdb_printf ("Process ID: %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_pid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_pid)));
printf_filtered ("Parent process: %s\n", gdb_printf ("Parent process: %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_ppid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_ppid)));
printf_filtered ("Process group: %s\n", gdb_printf ("Process group: %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_pgid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_pgid)));
printf_filtered ("Session id: %s\n", gdb_printf ("Session id: %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_sid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_sid)));
/* FreeBSD 12.0 and later store a 64-bit dev_t at 'ki_tdev'. Older /* FreeBSD 12.0 and later store a 64-bit dev_t at 'ki_tdev'. Older
kernels store a 32-bit dev_t at 'ki_tdev_freebsd11'. In older kernels store a 32-bit dev_t at 'ki_tdev_freebsd11'. In older
@ -1355,76 +1355,76 @@ fbsd_core_info_proc_status (struct gdbarch *gdbarch)
value = bfd_get_64 (core_bfd, descdata + kp->ki_tdev); value = bfd_get_64 (core_bfd, descdata + kp->ki_tdev);
if (value == 0) if (value == 0)
value = bfd_get_32 (core_bfd, descdata + kp->ki_tdev_freebsd11); value = bfd_get_32 (core_bfd, descdata + kp->ki_tdev_freebsd11);
printf_filtered ("TTY: %s\n", pulongest (value)); gdb_printf ("TTY: %s\n", pulongest (value));
printf_filtered ("TTY owner process group: %s\n", gdb_printf ("TTY owner process group: %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_tpgid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_tpgid)));
printf_filtered ("User IDs (real, effective, saved): %s %s %s\n", gdb_printf ("User IDs (real, effective, saved): %s %s %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_ruid)), pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_ruid)),
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_uid)), pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_uid)),
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_svuid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_svuid)));
printf_filtered ("Group IDs (real, effective, saved): %s %s %s\n", gdb_printf ("Group IDs (real, effective, saved): %s %s %s\n",
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_rgid)), pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_rgid)),
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_groups)), pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_groups)),
pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_svgid))); pulongest (bfd_get_32 (core_bfd, descdata + kp->ki_svgid)));
printf_filtered ("Groups: "); gdb_printf ("Groups: ");
uint16_t ngroups = bfd_get_16 (core_bfd, descdata + kp->ki_ngroups); uint16_t ngroups = bfd_get_16 (core_bfd, descdata + kp->ki_ngroups);
for (int i = 0; i < ngroups; i++) for (int i = 0; i < ngroups; i++)
printf_filtered ("%s ", gdb_printf ("%s ",
pulongest (bfd_get_32 (core_bfd, pulongest (bfd_get_32 (core_bfd,
descdata + kp->ki_groups + i * 4))); descdata + kp->ki_groups + i * 4)));
printf_filtered ("\n"); gdb_printf ("\n");
value = bfd_get (long_bit, core_bfd, value = bfd_get (long_bit, core_bfd,
descdata + kp->ki_rusage + kp->ru_minflt); descdata + kp->ki_rusage + kp->ru_minflt);
printf_filtered ("Minor faults (no memory page): %s\n", pulongest (value)); gdb_printf ("Minor faults (no memory page): %s\n", pulongest (value));
value = bfd_get (long_bit, core_bfd, value = bfd_get (long_bit, core_bfd,
descdata + kp->ki_rusage_ch + kp->ru_minflt); descdata + kp->ki_rusage_ch + kp->ru_minflt);
printf_filtered ("Minor faults, children: %s\n", pulongest (value)); gdb_printf ("Minor faults, children: %s\n", pulongest (value));
value = bfd_get (long_bit, core_bfd, value = bfd_get (long_bit, core_bfd,
descdata + kp->ki_rusage + kp->ru_majflt); descdata + kp->ki_rusage + kp->ru_majflt);
printf_filtered ("Major faults (memory page faults): %s\n", gdb_printf ("Major faults (memory page faults): %s\n",
pulongest (value)); pulongest (value));
value = bfd_get (long_bit, core_bfd, value = bfd_get (long_bit, core_bfd,
descdata + kp->ki_rusage_ch + kp->ru_majflt); descdata + kp->ki_rusage_ch + kp->ru_majflt);
printf_filtered ("Major faults, children: %s\n", pulongest (value)); gdb_printf ("Major faults, children: %s\n", pulongest (value));
fbsd_core_fetch_timeval (gdbarch, fbsd_core_fetch_timeval (gdbarch,
descdata + kp->ki_rusage + kp->ru_utime, descdata + kp->ki_rusage + kp->ru_utime,
sec, value); sec, value);
printf_filtered ("utime: %s.%06d\n", plongest (sec), (int) value); gdb_printf ("utime: %s.%06d\n", plongest (sec), (int) value);
fbsd_core_fetch_timeval (gdbarch, fbsd_core_fetch_timeval (gdbarch,
descdata + kp->ki_rusage + kp->ru_stime, descdata + kp->ki_rusage + kp->ru_stime,
sec, value); sec, value);
printf_filtered ("stime: %s.%06d\n", plongest (sec), (int) value); gdb_printf ("stime: %s.%06d\n", plongest (sec), (int) value);
fbsd_core_fetch_timeval (gdbarch, fbsd_core_fetch_timeval (gdbarch,
descdata + kp->ki_rusage_ch + kp->ru_utime, descdata + kp->ki_rusage_ch + kp->ru_utime,
sec, value); sec, value);
printf_filtered ("utime, children: %s.%06d\n", plongest (sec), (int) value); gdb_printf ("utime, children: %s.%06d\n", plongest (sec), (int) value);
fbsd_core_fetch_timeval (gdbarch, fbsd_core_fetch_timeval (gdbarch,
descdata + kp->ki_rusage_ch + kp->ru_stime, descdata + kp->ki_rusage_ch + kp->ru_stime,
sec, value); sec, value);
printf_filtered ("stime, children: %s.%06d\n", plongest (sec), (int) value); gdb_printf ("stime, children: %s.%06d\n", plongest (sec), (int) value);
printf_filtered ("'nice' value: %d\n", gdb_printf ("'nice' value: %d\n",
(int) bfd_get_signed_8 (core_bfd, descdata + kp->ki_nice)); (int) bfd_get_signed_8 (core_bfd, descdata + kp->ki_nice));
fbsd_core_fetch_timeval (gdbarch, descdata + kp->ki_start, sec, value); fbsd_core_fetch_timeval (gdbarch, descdata + kp->ki_start, sec, value);
printf_filtered ("Start time: %s.%06d\n", plongest (sec), (int) value); gdb_printf ("Start time: %s.%06d\n", plongest (sec), (int) value);
printf_filtered ("Virtual memory size: %s kB\n", gdb_printf ("Virtual memory size: %s kB\n",
pulongest (bfd_get (addr_bit, core_bfd, pulongest (bfd_get (addr_bit, core_bfd,
descdata + kp->ki_size) / 1024)); descdata + kp->ki_size) / 1024));
printf_filtered ("Data size: %s pages\n", gdb_printf ("Data size: %s pages\n",
pulongest (bfd_get (addr_bit, core_bfd, pulongest (bfd_get (addr_bit, core_bfd,
descdata + kp->ki_dsize))); descdata + kp->ki_dsize)));
printf_filtered ("Stack size: %s pages\n", gdb_printf ("Stack size: %s pages\n",
pulongest (bfd_get (addr_bit, core_bfd, pulongest (bfd_get (addr_bit, core_bfd,
descdata + kp->ki_ssize))); descdata + kp->ki_ssize)));
printf_filtered ("Text size: %s pages\n", gdb_printf ("Text size: %s pages\n",
pulongest (bfd_get (addr_bit, core_bfd, pulongest (bfd_get (addr_bit, core_bfd,
descdata + kp->ki_tsize))); descdata + kp->ki_tsize)));
printf_filtered ("Resident set size: %s pages\n", gdb_printf ("Resident set size: %s pages\n",
pulongest (bfd_get (addr_bit, core_bfd, pulongest (bfd_get (addr_bit, core_bfd,
descdata + kp->ki_rssize))); descdata + kp->ki_rssize)));
printf_filtered ("Maximum RSS: %s pages\n", gdb_printf ("Maximum RSS: %s pages\n",
pulongest (bfd_get (long_bit, core_bfd, pulongest (bfd_get (long_bit, core_bfd,
descdata + kp->ki_rusage descdata + kp->ki_rusage
+ kp->ru_maxrss))); + kp->ru_maxrss)));
fbsd_print_sigset ("Ignored Signals", descdata + kp->ki_sigignore); fbsd_print_sigset ("Ignored Signals", descdata + kp->ki_sigignore);
fbsd_print_sigset ("Caught Signals", descdata + kp->ki_sigcatch); fbsd_print_sigset ("Caught Signals", descdata + kp->ki_sigcatch);
} }
@ -1483,7 +1483,7 @@ fbsd_core_info_proc (struct gdbarch *gdbarch, const char *args,
pid = bfd_core_file_pid (core_bfd); pid = bfd_core_file_pid (core_bfd);
if (pid != 0) if (pid != 0)
printf_filtered (_("process %d\n"), pid); gdb_printf (_("process %d\n"), pid);
if (do_cmdline) if (do_cmdline)
{ {
@ -1491,7 +1491,7 @@ fbsd_core_info_proc (struct gdbarch *gdbarch, const char *args,
cmdline = bfd_core_file_failing_command (core_bfd); cmdline = bfd_core_file_failing_command (core_bfd);
if (cmdline) if (cmdline)
printf_filtered ("cmdline = '%s'\n", cmdline); gdb_printf ("cmdline = '%s'\n", cmdline);
else else
warning (_("Command line unavailable")); warning (_("Command line unavailable"));
} }
@ -1500,7 +1500,7 @@ fbsd_core_info_proc (struct gdbarch *gdbarch, const char *args,
gdb::unique_xmalloc_ptr<char> cwd = gdb::unique_xmalloc_ptr<char> cwd =
fbsd_core_vnode_path (gdbarch, KINFO_FILE_FD_TYPE_CWD); fbsd_core_vnode_path (gdbarch, KINFO_FILE_FD_TYPE_CWD);
if (cwd) if (cwd)
printf_filtered ("cwd = '%s'\n", cwd.get ()); gdb_printf ("cwd = '%s'\n", cwd.get ());
else else
warning (_("unable to read current working directory")); warning (_("unable to read current working directory"));
} }
@ -1509,7 +1509,7 @@ fbsd_core_info_proc (struct gdbarch *gdbarch, const char *args,
gdb::unique_xmalloc_ptr<char> exe = gdb::unique_xmalloc_ptr<char> exe =
fbsd_core_vnode_path (gdbarch, KINFO_FILE_FD_TYPE_TEXT); fbsd_core_vnode_path (gdbarch, KINFO_FILE_FD_TYPE_TEXT);
if (exe) if (exe)
printf_filtered ("exe = '%s'\n", exe.get ()); gdb_printf ("exe = '%s'\n", exe.get ());
else else
warning (_("unable to read executable path name")); warning (_("unable to read executable path name"));
} }

View file

@ -64,16 +64,16 @@ show_target_file_system_kind_command (struct ui_file *file,
const char *value) const char *value)
{ {
if (target_file_system_kind == file_system_kind_auto) if (target_file_system_kind == file_system_kind_auto)
fprintf_filtered (file, _("\ gdb_printf (file, _("\
The assumed file system kind for target reported file names \ The assumed file system kind for target reported file names \
is \"%s\" (currently \"%s\").\n"), is \"%s\" (currently \"%s\").\n"),
value, value,
effective_target_file_system_kind ()); effective_target_file_system_kind ());
else else
fprintf_filtered (file, _("\ gdb_printf (file, _("\
The assumed file system kind for target reported file names \ The assumed file system kind for target reported file names \
is \"%s\".\n"), is \"%s\".\n"),
value); value);
} }
void _initialize_filesystem (); void _initialize_filesystem ();

View file

@ -121,7 +121,7 @@ parse_find_args (const char *args, ULONGEST *max_countp,
len = value_as_long (v); len = value_as_long (v);
if (len == 0) if (len == 0)
{ {
printf_filtered (_("Empty search range.\n")); gdb_printf (_("Empty search range.\n"));
return pattern_buf; return pattern_buf;
} }
if (len < 0) if (len < 0)
@ -247,7 +247,7 @@ find_command (const char *args, int from_tty)
break; break;
print_address (gdbarch, found_addr, gdb_stdout); print_address (gdbarch, found_addr, gdb_stdout);
printf_filtered ("\n"); gdb_printf ("\n");
++found_count; ++found_count;
last_found_addr = found_addr; last_found_addr = found_addr;
@ -274,10 +274,10 @@ find_command (const char *args, int from_tty)
} }
if (found_count == 0) if (found_count == 0)
printf_filtered ("Pattern not found.\n"); gdb_printf ("Pattern not found.\n");
else else
printf_filtered ("%d pattern%s found.\n", found_count, gdb_printf ("%d pattern%s found.\n", found_count,
found_count > 1 ? "s" : ""); found_count > 1 ? "s" : "");
} }
void _initialize_mem_search (); void _initialize_mem_search ();

View file

@ -98,7 +98,7 @@ postfork_child_hook ()
static int debug_setpgrp = 657473; static int debug_setpgrp = 657473;
/* Make sure we switch to main_ui here in order to be able to /* Make sure we switch to main_ui here in order to be able to
use the fprintf_unfiltered/warning/error functions. */ use the gdb_printf/warning/error functions. */
current_ui = main_ui; current_ui = main_ui;
/* Create a new session for the inferior process, if necessary. /* Create a new session for the inferior process, if necessary.
@ -146,9 +146,9 @@ static void
show_startup_with_shell (struct ui_file *file, int from_tty, show_startup_with_shell (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Use of shell to start subprocesses is %s.\n"), _("Use of shell to start subprocesses is %s.\n"),
value); value);
} }
void _initialize_fork_child (); void _initialize_fork_child ();

View file

@ -339,7 +339,7 @@ static void
show_frame_debug (struct ui_file *file, int from_tty, show_frame_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Frame debugging is %s.\n"), value); gdb_printf (file, _("Frame debugging is %s.\n"), value);
} }
/* Implementation of "show backtrace past-main". */ /* Implementation of "show backtrace past-main". */
@ -348,10 +348,10 @@ static void
show_backtrace_past_main (struct ui_file *file, int from_tty, show_backtrace_past_main (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Whether backtraces should " _("Whether backtraces should "
"continue past \"main\" is %s.\n"), "continue past \"main\" is %s.\n"),
value); value);
} }
/* Implementation of "show backtrace past-entry". */ /* Implementation of "show backtrace past-entry". */
@ -360,9 +360,9 @@ static void
show_backtrace_past_entry (struct ui_file *file, int from_tty, show_backtrace_past_entry (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Whether backtraces should continue past the " gdb_printf (file, _("Whether backtraces should continue past the "
"entry point of a program is %s.\n"), "entry point of a program is %s.\n"),
value); value);
} }
/* Implementation of "show backtrace limit". */ /* Implementation of "show backtrace limit". */
@ -371,10 +371,10 @@ static void
show_backtrace_limit (struct ui_file *file, int from_tty, show_backtrace_limit (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("An upper bound on the number " _("An upper bound on the number "
"of backtrace levels is %s.\n"), "of backtrace levels is %s.\n"),
value); value);
} }
/* See frame.h. */ /* See frame.h. */
@ -1238,36 +1238,36 @@ frame_unwind_register_value (frame_info *next_frame, int regnum)
{ {
string_file debug_file; string_file debug_file;
fprintf_unfiltered (&debug_file, " ->"); gdb_printf (&debug_file, " ->");
if (value_optimized_out (value)) if (value_optimized_out (value))
{ {
fprintf_unfiltered (&debug_file, " "); gdb_printf (&debug_file, " ");
val_print_not_saved (&debug_file); val_print_not_saved (&debug_file);
} }
else else
{ {
if (VALUE_LVAL (value) == lval_register) if (VALUE_LVAL (value) == lval_register)
fprintf_unfiltered (&debug_file, " register=%d", gdb_printf (&debug_file, " register=%d",
VALUE_REGNUM (value)); VALUE_REGNUM (value));
else if (VALUE_LVAL (value) == lval_memory) else if (VALUE_LVAL (value) == lval_memory)
fprintf_unfiltered (&debug_file, " address=%s", gdb_printf (&debug_file, " address=%s",
paddress (gdbarch, paddress (gdbarch,
value_address (value))); value_address (value)));
else else
fprintf_unfiltered (&debug_file, " computed"); gdb_printf (&debug_file, " computed");
if (value_lazy (value)) if (value_lazy (value))
fprintf_unfiltered (&debug_file, " lazy"); gdb_printf (&debug_file, " lazy");
else else
{ {
int i; int i;
gdb::array_view<const gdb_byte> buf = value_contents (value); gdb::array_view<const gdb_byte> buf = value_contents (value);
fprintf_unfiltered (&debug_file, " bytes="); gdb_printf (&debug_file, " bytes=");
fprintf_unfiltered (&debug_file, "["); gdb_printf (&debug_file, "[");
for (i = 0; i < register_size (gdbarch, regnum); i++) for (i = 0; i < register_size (gdbarch, regnum); i++)
fprintf_unfiltered (&debug_file, "%02x", buf[i]); gdb_printf (&debug_file, "%02x", buf[i]);
fprintf_unfiltered (&debug_file, "]"); gdb_printf (&debug_file, "]");
} }
} }

View file

@ -140,8 +140,8 @@ gcore_command (const char *args, int from_tty)
} }
if (info_verbose) if (info_verbose)
printf_filtered ("Opening corefile '%s' for output.\n", gdb_printf ("Opening corefile '%s' for output.\n",
corefilename.get ()); corefilename.get ());
if (target_supports_dumpcore ()) if (target_supports_dumpcore ())
target_dumpcore (corefilename.get ()); target_dumpcore (corefilename.get ());
@ -160,7 +160,7 @@ gcore_command (const char *args, int from_tty)
unlink_file.keep (); unlink_file.keep ();
} }
printf_filtered ("Saved corefile %s\n", corefilename.get ()); gdb_printf ("Saved corefile %s\n", corefilename.get ());
} }
static enum bfd_architecture static enum bfd_architecture
@ -384,8 +384,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
{ {
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("Ignore segment, %s bytes at %s\n", gdb_printf ("Ignore segment, %s bytes at %s\n",
plongest (size), paddress (target_gdbarch (), vaddr)); plongest (size), paddress (target_gdbarch (), vaddr));
} }
return 0; return 0;
@ -444,8 +444,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
if (info_verbose) if (info_verbose)
{ {
printf_filtered ("Save segment, %s bytes at %s\n", gdb_printf ("Save segment, %s bytes at %s\n",
plongest (size), paddress (target_gdbarch (), vaddr)); plongest (size), paddress (target_gdbarch (), vaddr));
} }
bfd_set_section_size (osec, size); bfd_set_section_size (osec, size);

View file

@ -50,10 +50,10 @@ static void
show_demangle (struct ui_file *file, int from_tty, show_demangle (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Demangling of encoded C++/ObjC names " _("Demangling of encoded C++/ObjC names "
"when displaying symbols is %s.\n"), "when displaying symbols is %s.\n"),
value); value);
} }
/* See documentation in gdb-demangle.h. */ /* See documentation in gdb-demangle.h. */
@ -63,10 +63,10 @@ static void
show_asm_demangle (struct ui_file *file, int from_tty, show_asm_demangle (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, gdb_printf (file,
_("Demangling of C++/ObjC names in " _("Demangling of C++/ObjC names in "
"disassembly listings is %s.\n"), "disassembly listings is %s.\n"),
value); value);
} }
/* String name for the current demangling style. Set by the /* String name for the current demangling style. Set by the
@ -83,8 +83,8 @@ static void
show_demangling_style_names(struct ui_file *file, int from_tty, show_demangling_style_names(struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("The current C++ demangling style is \"%s\".\n"), gdb_printf (file, _("The current C++ demangling style is \"%s\".\n"),
value); value);
} }
/* Set current demangling style. Called by the "set demangle-style" /* Set current demangling style. Called by the "set demangle-style"
@ -204,7 +204,7 @@ demangle_command (const char *args, int from_tty)
gdb::unique_xmalloc_ptr<char> demangled gdb::unique_xmalloc_ptr<char> demangled
= language_demangle (lang, name, DMGL_ANSI | DMGL_PARAMS); = language_demangle (lang, name, DMGL_ANSI | DMGL_PARAMS);
if (demangled != NULL) if (demangled != NULL)
printf_filtered ("%s\n", demangled.get ()); gdb_printf ("%s\n", demangled.get ());
else else
error (_("Can't demangle \"%s\""), name); error (_("Can't demangle \"%s\""), name);
} }

View file

@ -132,7 +132,7 @@ static void
show_bfd_sharing (struct ui_file *file, int from_tty, show_bfd_sharing (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("BFD sharing is %s.\n"), value); gdb_printf (file, _("BFD sharing is %s.\n"), value);
} }
/* When true debugging of the bfd caches is enabled. */ /* When true debugging of the bfd caches is enabled. */
@ -148,7 +148,7 @@ static void
show_bfd_cache_debug (struct ui_file *file, int from_tty, show_bfd_cache_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("BFD cache debugging is %s.\n"), value); gdb_printf (file, _("BFD cache debugging is %s.\n"), value);
} }
/* The type of an object being looked up in gdb_bfd_cache. We use /* The type of an object being looked up in gdb_bfd_cache. We use

File diff suppressed because it is too large Load diff

View file

@ -391,19 +391,19 @@ with open("gdbarch.c", "w") as f:
print("#if defined (GDB_NM_FILE)", file=f) print("#if defined (GDB_NM_FILE)", file=f)
print(" gdb_nm_file = GDB_NM_FILE;", file=f) print(" gdb_nm_file = GDB_NM_FILE;", file=f)
print("#endif", file=f) print("#endif", file=f)
print(" fprintf_filtered (file,", file=f) print(" gdb_printf (file,", file=f)
print(""" "gdbarch_dump: GDB_NM_FILE = %s\\n",""", file=f) print(""" "gdbarch_dump: GDB_NM_FILE = %s\\n",""", file=f)
print(" gdb_nm_file);", file=f) print(" gdb_nm_file);", file=f)
for c in components: for c in components:
if c.predicate: if c.predicate:
print(" fprintf_filtered (file,", file=f) print(" gdb_printf (file,", file=f)
print( print(
f""" "gdbarch_dump: gdbarch_{c.name}_p() = %d\\n",""", f""" "gdbarch_dump: gdbarch_{c.name}_p() = %d\\n",""",
file=f, file=f,
) )
print(f" gdbarch_{c.name}_p (gdbarch));", file=f) print(f" gdbarch_{c.name}_p (gdbarch));", file=f)
if isinstance(c, Function): if isinstance(c, Function):
print(" fprintf_filtered (file,", file=f) print(" gdb_printf (file,", file=f)
print( print(
f""" "gdbarch_dump: {c.name} = <%s>\\n",""", file=f f""" "gdbarch_dump: {c.name} = <%s>\\n",""", file=f
) )
@ -418,7 +418,7 @@ with open("gdbarch.c", "w") as f:
printer = f"core_addr_to_string_nz (gdbarch->{c.name})" printer = f"core_addr_to_string_nz (gdbarch->{c.name})"
else: else:
printer = f"plongest (gdbarch->{c.name})" printer = f"plongest (gdbarch->{c.name})"
print(" fprintf_filtered (file,", file=f) print(" gdb_printf (file,", file=f)
print( print(
f""" "gdbarch_dump: {c.name} = %s\\n",""", file=f f""" "gdbarch_dump: {c.name} = %s\\n",""", file=f
) )
@ -454,7 +454,7 @@ with open("gdbarch.c", "w") as f:
) )
print(" if (gdbarch_debug >= 2)", file=f) print(" if (gdbarch_debug >= 2)", file=f)
print( print(
f""" fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""", f""" gdb_printf (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
file=f, file=f,
) )
print(" ", file=f, end="") print(" ", file=f, end="")
@ -488,7 +488,7 @@ with open("gdbarch.c", "w") as f:
print(f" gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f) print(f" gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f)
print(" if (gdbarch_debug >= 2)", file=f) print(" if (gdbarch_debug >= 2)", file=f)
print( print(
f""" fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""", f""" gdb_printf (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
file=f, file=f,
) )
print(f" return gdbarch->{c.name};", file=f) print(f" return gdbarch->{c.name};", file=f)
@ -509,7 +509,7 @@ with open("gdbarch.c", "w") as f:
print(" gdb_assert (gdbarch != NULL);", file=f) print(" gdb_assert (gdbarch != NULL);", file=f)
print(" if (gdbarch_debug >= 2)", file=f) print(" if (gdbarch_debug >= 2)", file=f)
print( print(
f""" fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""", f""" gdb_printf (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
file=f, file=f,
) )
print(f" return gdbarch->{c.name};", file=f) print(f" return gdbarch->{c.name};", file=f)

View file

@ -145,9 +145,9 @@ show_opaque_type_resolution (struct ui_file *file, int from_tty,
struct cmd_list_element *c, struct cmd_list_element *c,
const char *value) const char *value)
{ {
fprintf_filtered (file, _("Resolution of opaque struct/class/union types " gdb_printf (file, _("Resolution of opaque struct/class/union types "
"(if set before loading symbols) is %s.\n"), "(if set before loading symbols) is %s.\n"),
value); value);
} }
/* A function to show whether C++ overload debugging is enabled. */ /* A function to show whether C++ overload debugging is enabled. */
@ -156,8 +156,8 @@ static void
show_overload_debug (struct ui_file *file, int from_tty, show_overload_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging of C++ overloading is %s.\n"), gdb_printf (file, _("Debugging of C++ overloading is %s.\n"),
value); value);
} }
/* A function to show the status of strict type checking. */ /* A function to show the status of strict type checking. */
@ -166,7 +166,7 @@ static void
show_strict_type_checking (struct ui_file *file, int from_tty, show_strict_type_checking (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Strict type checking is %s.\n"), value); gdb_printf (file, _("Strict type checking is %s.\n"), value);
} }
@ -4836,10 +4836,10 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
if (overload_debug) if (overload_debug)
{ {
/* Debugging only. */ /* Debugging only. */
fprintf_filtered (gdb_stderr, gdb_printf (gdb_stderr,
"------ Arg is %s [%d], parm is %s [%d]\n", "------ Arg is %s [%d], parm is %s [%d]\n",
arg->name (), arg->code (), arg->name (), arg->code (),
parm->name (), parm->code ()); parm->name (), parm->code ());
} }
/* x -> y means arg of type x being supplied for parameter of type y. */ /* x -> y means arg of type x being supplied for parameter of type y. */
@ -4891,9 +4891,9 @@ print_bit_vector (B_TYPE *bits, int nbits)
gdb_puts (" "); gdb_puts (" ");
} }
if (B_TST (bits, bitno)) if (B_TST (bits, bitno))
printf_filtered (("1")); gdb_printf (("1"));
else else
printf_filtered (("0")); gdb_printf (("0"));
} }
} }
@ -4910,7 +4910,7 @@ print_args (struct field *args, int nargs, int spaces)
for (i = 0; i < nargs; i++) for (i = 0; i < nargs; i++)
{ {
printf_filtered gdb_printf
("%*s[%d] name '%s'\n", spaces, "", i, ("%*s[%d] name '%s'\n", spaces, "", i,
args[i].name () != NULL ? args[i].name () : "<NULL>"); args[i].name () != NULL ? args[i].name () : "<NULL>");
recursive_dump_type (args[i].type (), spaces + 2); recursive_dump_type (args[i].type (), spaces + 2);
@ -4937,12 +4937,12 @@ dump_fn_fieldlists (struct type *type, int spaces)
int overload_idx; int overload_idx;
struct fn_field *f; struct fn_field *f;
printf_filtered ("%*sfn_fieldlists %s\n", spaces, "", gdb_printf ("%*sfn_fieldlists %s\n", spaces, "",
host_address_to_string (TYPE_FN_FIELDLISTS (type))); host_address_to_string (TYPE_FN_FIELDLISTS (type)));
for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++) for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++)
{ {
f = TYPE_FN_FIELDLIST1 (type, method_idx); f = TYPE_FN_FIELDLIST1 (type, method_idx);
printf_filtered gdb_printf
("%*s[%d] name '%s' (%s) length %d\n", spaces + 2, "", ("%*s[%d] name '%s' (%s) length %d\n", spaces + 2, "",
method_idx, method_idx,
TYPE_FN_FIELDLIST_NAME (type, method_idx), TYPE_FN_FIELDLIST_NAME (type, method_idx),
@ -4952,46 +4952,46 @@ dump_fn_fieldlists (struct type *type, int spaces)
overload_idx < TYPE_FN_FIELDLIST_LENGTH (type, method_idx); overload_idx < TYPE_FN_FIELDLIST_LENGTH (type, method_idx);
overload_idx++) overload_idx++)
{ {
printf_filtered gdb_printf
("%*s[%d] physname '%s' (%s)\n", ("%*s[%d] physname '%s' (%s)\n",
spaces + 4, "", overload_idx, spaces + 4, "", overload_idx,
TYPE_FN_FIELD_PHYSNAME (f, overload_idx), TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
host_address_to_string (TYPE_FN_FIELD_PHYSNAME (f, host_address_to_string (TYPE_FN_FIELD_PHYSNAME (f,
overload_idx))); overload_idx)));
printf_filtered gdb_printf
("%*stype %s\n", spaces + 8, "", ("%*stype %s\n", spaces + 8, "",
host_address_to_string (TYPE_FN_FIELD_TYPE (f, overload_idx))); host_address_to_string (TYPE_FN_FIELD_TYPE (f, overload_idx)));
recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx), recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx),
spaces + 8 + 2); spaces + 8 + 2);
printf_filtered gdb_printf
("%*sargs %s\n", spaces + 8, "", ("%*sargs %s\n", spaces + 8, "",
host_address_to_string (TYPE_FN_FIELD_ARGS (f, overload_idx))); host_address_to_string (TYPE_FN_FIELD_ARGS (f, overload_idx)));
print_args (TYPE_FN_FIELD_ARGS (f, overload_idx), print_args (TYPE_FN_FIELD_ARGS (f, overload_idx),
TYPE_FN_FIELD_TYPE (f, overload_idx)->num_fields (), TYPE_FN_FIELD_TYPE (f, overload_idx)->num_fields (),
spaces + 8 + 2); spaces + 8 + 2);
printf_filtered gdb_printf
("%*sfcontext %s\n", spaces + 8, "", ("%*sfcontext %s\n", spaces + 8, "",
host_address_to_string (TYPE_FN_FIELD_FCONTEXT (f, host_address_to_string (TYPE_FN_FIELD_FCONTEXT (f,
overload_idx))); overload_idx)));
printf_filtered ("%*sis_const %d\n", spaces + 8, "", gdb_printf ("%*sis_const %d\n", spaces + 8, "",
TYPE_FN_FIELD_CONST (f, overload_idx)); TYPE_FN_FIELD_CONST (f, overload_idx));
printf_filtered ("%*sis_volatile %d\n", spaces + 8, "", gdb_printf ("%*sis_volatile %d\n", spaces + 8, "",
TYPE_FN_FIELD_VOLATILE (f, overload_idx)); TYPE_FN_FIELD_VOLATILE (f, overload_idx));
printf_filtered ("%*sis_private %d\n", spaces + 8, "", gdb_printf ("%*sis_private %d\n", spaces + 8, "",
TYPE_FN_FIELD_PRIVATE (f, overload_idx)); TYPE_FN_FIELD_PRIVATE (f, overload_idx));
printf_filtered ("%*sis_protected %d\n", spaces + 8, "", gdb_printf ("%*sis_protected %d\n", spaces + 8, "",
TYPE_FN_FIELD_PROTECTED (f, overload_idx)); TYPE_FN_FIELD_PROTECTED (f, overload_idx));
printf_filtered ("%*sis_stub %d\n", spaces + 8, "", gdb_printf ("%*sis_stub %d\n", spaces + 8, "",
TYPE_FN_FIELD_STUB (f, overload_idx)); TYPE_FN_FIELD_STUB (f, overload_idx));
printf_filtered ("%*sdefaulted %d\n", spaces + 8, "", gdb_printf ("%*sdefaulted %d\n", spaces + 8, "",
TYPE_FN_FIELD_DEFAULTED (f, overload_idx)); TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
printf_filtered ("%*sis_deleted %d\n", spaces + 8, "", gdb_printf ("%*sis_deleted %d\n", spaces + 8, "",
TYPE_FN_FIELD_DELETED (f, overload_idx)); TYPE_FN_FIELD_DELETED (f, overload_idx));
printf_filtered ("%*svoffset %u\n", spaces + 8, "", gdb_printf ("%*svoffset %u\n", spaces + 8, "",
TYPE_FN_FIELD_VOFFSET (f, overload_idx)); TYPE_FN_FIELD_VOFFSET (f, overload_idx));
} }
} }
} }
@ -4999,20 +4999,20 @@ dump_fn_fieldlists (struct type *type, int spaces)
static void static void
print_cplus_stuff (struct type *type, int spaces) print_cplus_stuff (struct type *type, int spaces)
{ {
printf_filtered ("%*svptr_fieldno %d\n", spaces, "", gdb_printf ("%*svptr_fieldno %d\n", spaces, "",
TYPE_VPTR_FIELDNO (type)); TYPE_VPTR_FIELDNO (type));
printf_filtered ("%*svptr_basetype %s\n", spaces, "", gdb_printf ("%*svptr_basetype %s\n", spaces, "",
host_address_to_string (TYPE_VPTR_BASETYPE (type))); host_address_to_string (TYPE_VPTR_BASETYPE (type)));
if (TYPE_VPTR_BASETYPE (type) != NULL) if (TYPE_VPTR_BASETYPE (type) != NULL)
recursive_dump_type (TYPE_VPTR_BASETYPE (type), spaces + 2); recursive_dump_type (TYPE_VPTR_BASETYPE (type), spaces + 2);
printf_filtered ("%*sn_baseclasses %d\n", spaces, "", gdb_printf ("%*sn_baseclasses %d\n", spaces, "",
TYPE_N_BASECLASSES (type)); TYPE_N_BASECLASSES (type));
printf_filtered ("%*snfn_fields %d\n", spaces, "", gdb_printf ("%*snfn_fields %d\n", spaces, "",
TYPE_NFN_FIELDS (type)); TYPE_NFN_FIELDS (type));
if (TYPE_N_BASECLASSES (type) > 0) if (TYPE_N_BASECLASSES (type) > 0)
{ {
printf_filtered gdb_printf
("%*svirtual_field_bits (%d bits at *%s)", ("%*svirtual_field_bits (%d bits at *%s)",
spaces, "", TYPE_N_BASECLASSES (type), spaces, "", TYPE_N_BASECLASSES (type),
host_address_to_string (TYPE_FIELD_VIRTUAL_BITS (type))); host_address_to_string (TYPE_FIELD_VIRTUAL_BITS (type)));
@ -5025,7 +5025,7 @@ print_cplus_stuff (struct type *type, int spaces)
{ {
if (TYPE_FIELD_PRIVATE_BITS (type) != NULL) if (TYPE_FIELD_PRIVATE_BITS (type) != NULL)
{ {
printf_filtered gdb_printf
("%*sprivate_field_bits (%d bits at *%s)", ("%*sprivate_field_bits (%d bits at *%s)",
spaces, "", type->num_fields (), spaces, "", type->num_fields (),
host_address_to_string (TYPE_FIELD_PRIVATE_BITS (type))); host_address_to_string (TYPE_FIELD_PRIVATE_BITS (type)));
@ -5035,7 +5035,7 @@ print_cplus_stuff (struct type *type, int spaces)
} }
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL) if (TYPE_FIELD_PROTECTED_BITS (type) != NULL)
{ {
printf_filtered gdb_printf
("%*sprotected_field_bits (%d bits at *%s", ("%*sprotected_field_bits (%d bits at *%s",
spaces, "", type->num_fields (), spaces, "", type->num_fields (),
host_address_to_string (TYPE_FIELD_PROTECTED_BITS (type))); host_address_to_string (TYPE_FIELD_PROTECTED_BITS (type)));
@ -5049,8 +5049,8 @@ print_cplus_stuff (struct type *type, int spaces)
dump_fn_fieldlists (type, spaces); dump_fn_fieldlists (type, spaces);
} }
printf_filtered ("%*scalling_convention %d\n", spaces, "", gdb_printf ("%*scalling_convention %d\n", spaces, "",
TYPE_CPLUS_CALLING_CONVENTION (type)); TYPE_CPLUS_CALLING_CONVENTION (type));
} }
/* Print the contents of the TYPE's type_specific union, assuming that /* Print the contents of the TYPE's type_specific union, assuming that
@ -5062,10 +5062,10 @@ print_gnat_stuff (struct type *type, int spaces)
struct type *descriptive_type = TYPE_DESCRIPTIVE_TYPE (type); struct type *descriptive_type = TYPE_DESCRIPTIVE_TYPE (type);
if (descriptive_type == NULL) if (descriptive_type == NULL)
printf_filtered ("%*sno descriptive type\n", spaces + 2, ""); gdb_printf ("%*sno descriptive type\n", spaces + 2, "");
else else
{ {
printf_filtered ("%*sdescriptive type\n", spaces + 2, ""); gdb_printf ("%*sdescriptive type\n", spaces + 2, "");
recursive_dump_type (descriptive_type, spaces + 4); recursive_dump_type (descriptive_type, spaces + 4);
} }
} }
@ -5076,8 +5076,8 @@ print_gnat_stuff (struct type *type, int spaces)
static void static void
print_fixed_point_type_info (struct type *type, int spaces) print_fixed_point_type_info (struct type *type, int spaces)
{ {
printf_filtered ("%*sscaling factor: %s\n", spaces + 2, "", gdb_printf ("%*sscaling factor: %s\n", spaces + 2, "",
type->fixed_point_scaling_factor ().str ().c_str ()); type->fixed_point_scaling_factor ().str ().c_str ());
} }
static struct obstack dont_print_type_obstack; static struct obstack dont_print_type_obstack;
@ -5090,14 +5090,14 @@ dump_dynamic_prop (dynamic_prop const& prop)
switch (prop.kind ()) switch (prop.kind ())
{ {
case PROP_CONST: case PROP_CONST:
printf_filtered ("%s", plongest (prop.const_val ())); gdb_printf ("%s", plongest (prop.const_val ()));
break; break;
case PROP_UNDEFINED: case PROP_UNDEFINED:
printf_filtered ("(undefined)"); gdb_printf ("(undefined)");
break; break;
case PROP_LOCEXPR: case PROP_LOCEXPR:
case PROP_LOCLIST: case PROP_LOCLIST:
printf_filtered ("(dynamic)"); gdb_printf ("(dynamic)");
break; break;
default: default:
gdb_assert_not_reached ("unhandled prop kind"); gdb_assert_not_reached ("unhandled prop kind");
@ -5126,9 +5126,9 @@ recursive_dump_type (struct type *type, int spaces)
{ {
if (type == first_dont_print[i]) if (type == first_dont_print[i])
{ {
printf_filtered ("%*stype node %s", spaces, "", gdb_printf ("%*stype node %s", spaces, "",
host_address_to_string (type)); host_address_to_string (type));
printf_filtered (_(" <same as already seen type>\n")); gdb_printf (_(" <same as already seen type>\n"));
return; return;
} }
} }
@ -5136,116 +5136,116 @@ recursive_dump_type (struct type *type, int spaces)
obstack_ptr_grow (&dont_print_type_obstack, type); obstack_ptr_grow (&dont_print_type_obstack, type);
} }
printf_filtered ("%*stype node %s\n", spaces, "", gdb_printf ("%*stype node %s\n", spaces, "",
host_address_to_string (type)); host_address_to_string (type));
printf_filtered ("%*sname '%s' (%s)\n", spaces, "", gdb_printf ("%*sname '%s' (%s)\n", spaces, "",
type->name () ? type->name () : "<NULL>", type->name () ? type->name () : "<NULL>",
host_address_to_string (type->name ())); host_address_to_string (type->name ()));
printf_filtered ("%*scode 0x%x ", spaces, "", type->code ()); gdb_printf ("%*scode 0x%x ", spaces, "", type->code ());
switch (type->code ()) switch (type->code ())
{ {
case TYPE_CODE_UNDEF: case TYPE_CODE_UNDEF:
printf_filtered ("(TYPE_CODE_UNDEF)"); gdb_printf ("(TYPE_CODE_UNDEF)");
break; break;
case TYPE_CODE_PTR: case TYPE_CODE_PTR:
printf_filtered ("(TYPE_CODE_PTR)"); gdb_printf ("(TYPE_CODE_PTR)");
break; break;
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
printf_filtered ("(TYPE_CODE_ARRAY)"); gdb_printf ("(TYPE_CODE_ARRAY)");
break; break;
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
printf_filtered ("(TYPE_CODE_STRUCT)"); gdb_printf ("(TYPE_CODE_STRUCT)");
break; break;
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
printf_filtered ("(TYPE_CODE_UNION)"); gdb_printf ("(TYPE_CODE_UNION)");
break; break;
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
printf_filtered ("(TYPE_CODE_ENUM)"); gdb_printf ("(TYPE_CODE_ENUM)");
break; break;
case TYPE_CODE_FLAGS: case TYPE_CODE_FLAGS:
printf_filtered ("(TYPE_CODE_FLAGS)"); gdb_printf ("(TYPE_CODE_FLAGS)");
break; break;
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
printf_filtered ("(TYPE_CODE_FUNC)"); gdb_printf ("(TYPE_CODE_FUNC)");
break; break;
case TYPE_CODE_INT: case TYPE_CODE_INT:
printf_filtered ("(TYPE_CODE_INT)"); gdb_printf ("(TYPE_CODE_INT)");
break; break;
case TYPE_CODE_FLT: case TYPE_CODE_FLT:
printf_filtered ("(TYPE_CODE_FLT)"); gdb_printf ("(TYPE_CODE_FLT)");
break; break;
case TYPE_CODE_VOID: case TYPE_CODE_VOID:
printf_filtered ("(TYPE_CODE_VOID)"); gdb_printf ("(TYPE_CODE_VOID)");
break; break;
case TYPE_CODE_SET: case TYPE_CODE_SET:
printf_filtered ("(TYPE_CODE_SET)"); gdb_printf ("(TYPE_CODE_SET)");
break; break;
case TYPE_CODE_RANGE: case TYPE_CODE_RANGE:
printf_filtered ("(TYPE_CODE_RANGE)"); gdb_printf ("(TYPE_CODE_RANGE)");
break; break;
case TYPE_CODE_STRING: case TYPE_CODE_STRING:
printf_filtered ("(TYPE_CODE_STRING)"); gdb_printf ("(TYPE_CODE_STRING)");
break; break;
case TYPE_CODE_ERROR: case TYPE_CODE_ERROR:
printf_filtered ("(TYPE_CODE_ERROR)"); gdb_printf ("(TYPE_CODE_ERROR)");
break; break;
case TYPE_CODE_MEMBERPTR: case TYPE_CODE_MEMBERPTR:
printf_filtered ("(TYPE_CODE_MEMBERPTR)"); gdb_printf ("(TYPE_CODE_MEMBERPTR)");
break; break;
case TYPE_CODE_METHODPTR: case TYPE_CODE_METHODPTR:
printf_filtered ("(TYPE_CODE_METHODPTR)"); gdb_printf ("(TYPE_CODE_METHODPTR)");
break; break;
case TYPE_CODE_METHOD: case TYPE_CODE_METHOD:
printf_filtered ("(TYPE_CODE_METHOD)"); gdb_printf ("(TYPE_CODE_METHOD)");
break; break;
case TYPE_CODE_REF: case TYPE_CODE_REF:
printf_filtered ("(TYPE_CODE_REF)"); gdb_printf ("(TYPE_CODE_REF)");
break; break;
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
printf_filtered ("(TYPE_CODE_CHAR)"); gdb_printf ("(TYPE_CODE_CHAR)");
break; break;
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
printf_filtered ("(TYPE_CODE_BOOL)"); gdb_printf ("(TYPE_CODE_BOOL)");
break; break;
case TYPE_CODE_COMPLEX: case TYPE_CODE_COMPLEX:
printf_filtered ("(TYPE_CODE_COMPLEX)"); gdb_printf ("(TYPE_CODE_COMPLEX)");
break; break;
case TYPE_CODE_TYPEDEF: case TYPE_CODE_TYPEDEF:
printf_filtered ("(TYPE_CODE_TYPEDEF)"); gdb_printf ("(TYPE_CODE_TYPEDEF)");
break; break;
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
printf_filtered ("(TYPE_CODE_NAMESPACE)"); gdb_printf ("(TYPE_CODE_NAMESPACE)");
break; break;
case TYPE_CODE_FIXED_POINT: case TYPE_CODE_FIXED_POINT:
printf_filtered ("(TYPE_CODE_FIXED_POINT)"); gdb_printf ("(TYPE_CODE_FIXED_POINT)");
break; break;
default: default:
printf_filtered ("(UNKNOWN TYPE CODE)"); gdb_printf ("(UNKNOWN TYPE CODE)");
break; break;
} }
gdb_puts ("\n"); gdb_puts ("\n");
printf_filtered ("%*slength %s\n", spaces, "", gdb_printf ("%*slength %s\n", spaces, "",
pulongest (TYPE_LENGTH (type))); pulongest (TYPE_LENGTH (type)));
if (type->is_objfile_owned ()) if (type->is_objfile_owned ())
printf_filtered ("%*sobjfile %s\n", spaces, "", gdb_printf ("%*sobjfile %s\n", spaces, "",
host_address_to_string (type->objfile_owner ())); host_address_to_string (type->objfile_owner ()));
else else
printf_filtered ("%*sgdbarch %s\n", spaces, "", gdb_printf ("%*sgdbarch %s\n", spaces, "",
host_address_to_string (type->arch_owner ())); host_address_to_string (type->arch_owner ()));
printf_filtered ("%*starget_type %s\n", spaces, "", gdb_printf ("%*starget_type %s\n", spaces, "",
host_address_to_string (TYPE_TARGET_TYPE (type))); host_address_to_string (TYPE_TARGET_TYPE (type)));
if (TYPE_TARGET_TYPE (type) != NULL) if (TYPE_TARGET_TYPE (type) != NULL)
{ {
recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2); recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2);
} }
printf_filtered ("%*spointer_type %s\n", spaces, "", gdb_printf ("%*spointer_type %s\n", spaces, "",
host_address_to_string (TYPE_POINTER_TYPE (type))); host_address_to_string (TYPE_POINTER_TYPE (type)));
printf_filtered ("%*sreference_type %s\n", spaces, "", gdb_printf ("%*sreference_type %s\n", spaces, "",
host_address_to_string (TYPE_REFERENCE_TYPE (type))); host_address_to_string (TYPE_REFERENCE_TYPE (type)));
printf_filtered ("%*stype_chain %s\n", spaces, "", gdb_printf ("%*stype_chain %s\n", spaces, "",
host_address_to_string (TYPE_CHAIN (type))); host_address_to_string (TYPE_CHAIN (type)));
printf_filtered ("%*sinstance_flags 0x%x", spaces, "", gdb_printf ("%*sinstance_flags 0x%x", spaces, "",
(unsigned) type->instance_flags ()); (unsigned) type->instance_flags ());
if (TYPE_CONST (type)) if (TYPE_CONST (type))
{ {
gdb_puts (" TYPE_CONST"); gdb_puts (" TYPE_CONST");
@ -5280,7 +5280,7 @@ recursive_dump_type (struct type *type, int spaces)
} }
gdb_puts ("\n"); gdb_puts ("\n");
printf_filtered ("%*sflags", spaces, ""); gdb_printf ("%*sflags", spaces, "");
if (type->is_unsigned ()) if (type->is_unsigned ())
{ {
gdb_puts (" TYPE_UNSIGNED"); gdb_puts (" TYPE_UNSIGNED");
@ -5329,41 +5329,41 @@ recursive_dump_type (struct type *type, int spaces)
gdb_puts (" TYPE_NOTTEXT"); gdb_puts (" TYPE_NOTTEXT");
} }
gdb_puts ("\n"); gdb_puts ("\n");
printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ()); gdb_printf ("%*snfields %d ", spaces, "", type->num_fields ());
if (TYPE_ASSOCIATED_PROP (type) != nullptr if (TYPE_ASSOCIATED_PROP (type) != nullptr
|| TYPE_ALLOCATED_PROP (type) != nullptr) || TYPE_ALLOCATED_PROP (type) != nullptr)
{ {
printf_filtered ("%*s", spaces, ""); gdb_printf ("%*s", spaces, "");
if (TYPE_ASSOCIATED_PROP (type) != nullptr) if (TYPE_ASSOCIATED_PROP (type) != nullptr)
{ {
printf_filtered ("associated "); gdb_printf ("associated ");
dump_dynamic_prop (*TYPE_ASSOCIATED_PROP (type)); dump_dynamic_prop (*TYPE_ASSOCIATED_PROP (type));
} }
if (TYPE_ALLOCATED_PROP (type) != nullptr) if (TYPE_ALLOCATED_PROP (type) != nullptr)
{ {
if (TYPE_ASSOCIATED_PROP (type) != nullptr) if (TYPE_ASSOCIATED_PROP (type) != nullptr)
printf_filtered (" "); gdb_printf (" ");
printf_filtered ("allocated "); gdb_printf ("allocated ");
dump_dynamic_prop (*TYPE_ALLOCATED_PROP (type)); dump_dynamic_prop (*TYPE_ALLOCATED_PROP (type));
} }
printf_filtered ("\n"); gdb_printf ("\n");
} }
printf_filtered ("%s\n", host_address_to_string (type->fields ())); gdb_printf ("%s\n", host_address_to_string (type->fields ()));
for (idx = 0; idx < type->num_fields (); idx++) for (idx = 0; idx < type->num_fields (); idx++)
{ {
if (type->code () == TYPE_CODE_ENUM) if (type->code () == TYPE_CODE_ENUM)
printf_filtered ("%*s[%d] enumval %s type ", spaces + 2, "", gdb_printf ("%*s[%d] enumval %s type ", spaces + 2, "",
idx, plongest (type->field (idx).loc_enumval ())); idx, plongest (type->field (idx).loc_enumval ()));
else else
printf_filtered ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "", gdb_printf ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "",
idx, plongest (type->field (idx).loc_bitpos ()), idx, plongest (type->field (idx).loc_bitpos ()),
TYPE_FIELD_BITSIZE (type, idx)); TYPE_FIELD_BITSIZE (type, idx));
printf_filtered ("%s name '%s' (%s)\n", gdb_printf ("%s name '%s' (%s)\n",
host_address_to_string (type->field (idx).type ()), host_address_to_string (type->field (idx).type ()),
type->field (idx).name () != NULL type->field (idx).name () != NULL
? type->field (idx).name () ? type->field (idx).name ()
: "<NULL>", : "<NULL>",
host_address_to_string (type->field (idx).name ())); host_address_to_string (type->field (idx).name ()));
if (type->field (idx).type () != NULL) if (type->field (idx).type () != NULL)
{ {
recursive_dump_type (type->field (idx).type (), spaces + 4); recursive_dump_type (type->field (idx).type (), spaces + 4);
@ -5371,29 +5371,29 @@ recursive_dump_type (struct type *type, int spaces)
} }
if (type->code () == TYPE_CODE_RANGE) if (type->code () == TYPE_CODE_RANGE)
{ {
printf_filtered ("%*slow ", spaces, ""); gdb_printf ("%*slow ", spaces, "");
dump_dynamic_prop (type->bounds ()->low); dump_dynamic_prop (type->bounds ()->low);
printf_filtered (" high "); gdb_printf (" high ");
dump_dynamic_prop (type->bounds ()->high); dump_dynamic_prop (type->bounds ()->high);
printf_filtered ("\n"); gdb_printf ("\n");
} }
switch (TYPE_SPECIFIC_FIELD (type)) switch (TYPE_SPECIFIC_FIELD (type))
{ {
case TYPE_SPECIFIC_CPLUS_STUFF: case TYPE_SPECIFIC_CPLUS_STUFF:
printf_filtered ("%*scplus_stuff %s\n", spaces, "", gdb_printf ("%*scplus_stuff %s\n", spaces, "",
host_address_to_string (TYPE_CPLUS_SPECIFIC (type))); host_address_to_string (TYPE_CPLUS_SPECIFIC (type)));
print_cplus_stuff (type, spaces); print_cplus_stuff (type, spaces);
break; break;
case TYPE_SPECIFIC_GNAT_STUFF: case TYPE_SPECIFIC_GNAT_STUFF:
printf_filtered ("%*sgnat_stuff %s\n", spaces, "", gdb_printf ("%*sgnat_stuff %s\n", spaces, "",
host_address_to_string (TYPE_GNAT_SPECIFIC (type))); host_address_to_string (TYPE_GNAT_SPECIFIC (type)));
print_gnat_stuff (type, spaces); print_gnat_stuff (type, spaces);
break; break;
case TYPE_SPECIFIC_FLOATFORMAT: case TYPE_SPECIFIC_FLOATFORMAT:
printf_filtered ("%*sfloatformat ", spaces, ""); gdb_printf ("%*sfloatformat ", spaces, "");
if (TYPE_FLOATFORMAT (type) == NULL if (TYPE_FLOATFORMAT (type) == NULL
|| TYPE_FLOATFORMAT (type)->name == NULL) || TYPE_FLOATFORMAT (type)->name == NULL)
gdb_puts ("(null)"); gdb_puts ("(null)");
@ -5403,18 +5403,18 @@ recursive_dump_type (struct type *type, int spaces)
break; break;
case TYPE_SPECIFIC_FUNC: case TYPE_SPECIFIC_FUNC:
printf_filtered ("%*scalling_convention %d\n", spaces, "", gdb_printf ("%*scalling_convention %d\n", spaces, "",
TYPE_CALLING_CONVENTION (type)); TYPE_CALLING_CONVENTION (type));
/* tail_call_list is not printed. */ /* tail_call_list is not printed. */
break; break;
case TYPE_SPECIFIC_SELF_TYPE: case TYPE_SPECIFIC_SELF_TYPE:
printf_filtered ("%*sself_type %s\n", spaces, "", gdb_printf ("%*sself_type %s\n", spaces, "",
host_address_to_string (TYPE_SELF_TYPE (type))); host_address_to_string (TYPE_SELF_TYPE (type)));
break; break;
case TYPE_SPECIFIC_FIXED_POINT: case TYPE_SPECIFIC_FIXED_POINT:
printf_filtered ("%*sfixed_point_info ", spaces, ""); gdb_printf ("%*sfixed_point_info ", spaces, "");
print_fixed_point_type_info (type, spaces); print_fixed_point_type_info (type, spaces);
gdb_puts ("\n"); gdb_puts ("\n");
break; break;
@ -5424,8 +5424,8 @@ recursive_dump_type (struct type *type, int spaces)
{ {
unsigned bit_size = type->bit_size (); unsigned bit_size = type->bit_size ();
unsigned bit_off = type->bit_offset (); unsigned bit_off = type->bit_offset ();
printf_filtered ("%*s bit size = %u, bit offset = %u\n", spaces, "", gdb_printf ("%*s bit size = %u, bit offset = %u\n", spaces, "",
bit_size, bit_off); bit_size, bit_off);
} }
break; break;
} }

View file

@ -2775,10 +2775,10 @@ show_task_pause_cmd (const char *args, int from_tty)
struct inf *inf = cur_inf (); struct inf *inf = cur_inf ();
check_empty (args, "show task pause"); check_empty (args, "show task pause");
printf_filtered ("The inferior task %s suspended while gdb has control.\n", gdb_printf ("The inferior task %s suspended while gdb has control.\n",
inf->task inf->task
? (inf->pause_sc == 0 ? "isn't" : "is") ? (inf->pause_sc == 0 ? "isn't" : "is")
: (inf->pause_sc == 0 ? "won't be" : "will be")); : (inf->pause_sc == 0 ? "won't be" : "will be"));
} }
static void static void
@ -2792,9 +2792,9 @@ static void
show_task_detach_sc_cmd (const char *args, int from_tty) show_task_detach_sc_cmd (const char *args, int from_tty)
{ {
check_empty (args, "show task detach-suspend-count"); check_empty (args, "show task detach-suspend-count");
printf_filtered ("The inferior task will be left with a " gdb_printf ("The inferior task will be left with a "
"suspend count of %d when detaching.\n", "suspend count of %d when detaching.\n",
cur_inf ()->detach_sc); cur_inf ()->detach_sc);
} }
@ -2814,9 +2814,9 @@ show_thread_default_pause_cmd (const char *args, int from_tty)
int sc = inf->default_thread_pause_sc; int sc = inf->default_thread_pause_sc;
check_empty (args, "show thread default pause"); check_empty (args, "show thread default pause");
printf_filtered ("New threads %s suspended while gdb has control%s.\n", gdb_printf ("New threads %s suspended while gdb has control%s.\n",
sc ? "are" : "aren't", sc ? "are" : "aren't",
!sc && inf->pause_sc ? " (but the task is)" : ""); !sc && inf->pause_sc ? " (but the task is)" : "");
} }
static void static void
@ -2834,8 +2834,8 @@ show_thread_default_run_cmd (const char *args, int from_tty)
struct inf *inf = cur_inf (); struct inf *inf = cur_inf ();
check_empty (args, "show thread default run"); check_empty (args, "show thread default run");
printf_filtered ("New threads %s allowed to run.\n", gdb_printf ("New threads %s allowed to run.\n",
inf->default_thread_run_sc == 0 ? "are" : "aren't"); inf->default_thread_run_sc == 0 ? "are" : "aren't");
} }
static void static void
@ -2849,8 +2849,8 @@ static void
show_thread_default_detach_sc_cmd (const char *args, int from_tty) show_thread_default_detach_sc_cmd (const char *args, int from_tty)
{ {
check_empty (args, "show thread default detach-suspend-count"); check_empty (args, "show thread default detach-suspend-count");
printf_filtered ("New threads will get a detach-suspend-count of %d.\n", gdb_printf ("New threads will get a detach-suspend-count of %d.\n",
cur_inf ()->default_thread_detach_sc); cur_inf ()->default_thread_detach_sc);
} }
@ -2913,8 +2913,8 @@ show_stopped_cmd (const char *args, int from_tty)
struct inf *inf = active_inf (); struct inf *inf = active_inf ();
check_empty (args, "show stopped"); check_empty (args, "show stopped");
printf_filtered ("The inferior process %s stopped.\n", gdb_printf ("The inferior process %s stopped.\n",
inf->stopped ? "is" : "isn't"); inf->stopped ? "is" : "isn't");
} }
static void static void
@ -2942,10 +2942,10 @@ show_sig_thread_cmd (const char *args, int from_tty)
check_empty (args, "show signal-thread"); check_empty (args, "show signal-thread");
if (inf->signal_thread) if (inf->signal_thread)
printf_filtered ("The signal thread is %s.\n", gdb_printf ("The signal thread is %s.\n",
proc_string (inf->signal_thread)); proc_string (inf->signal_thread));
else else
printf_filtered ("There is no signal thread.\n"); gdb_printf ("There is no signal thread.\n");
} }
@ -2973,10 +2973,10 @@ show_signals_cmd (const char *args, int from_tty)
struct inf *inf = cur_inf (); struct inf *inf = cur_inf ();
check_empty (args, "show signals"); check_empty (args, "show signals");
printf_filtered ("The inferior process's signals %s intercepted.\n", gdb_printf ("The inferior process's signals %s intercepted.\n",
inf->task inf->task
? (inf->traced ? "are" : "aren't") ? (inf->traced ? "are" : "aren't")
: (inf->want_signals ? "will be" : "won't be")); : (inf->want_signals ? "will be" : "won't be"));
} }
static void static void
@ -3002,18 +3002,18 @@ show_exceptions_cmd (const char *args, int from_tty)
struct inf *inf = cur_inf (); struct inf *inf = cur_inf ();
check_empty (args, "show exceptions"); check_empty (args, "show exceptions");
printf_filtered ("Exceptions in the inferior %s trapped.\n", gdb_printf ("Exceptions in the inferior %s trapped.\n",
inf->task inf->task
? (inf->want_exceptions ? "are" : "aren't") ? (inf->want_exceptions ? "are" : "aren't")
: (inf->want_exceptions ? "will be" : "won't be")); : (inf->want_exceptions ? "will be" : "won't be"));
} }
static void static void
set_task_cmd (const char *args, int from_tty) set_task_cmd (const char *args, int from_tty)
{ {
printf_filtered ("\"set task\" must be followed by the name" gdb_printf ("\"set task\" must be followed by the name"
" of a task property.\n"); " of a task property.\n");
} }
static void static void
@ -3277,10 +3277,10 @@ show_thread_pause_cmd (const char *args, int from_tty)
int sc = thread->pause_sc; int sc = thread->pause_sc;
check_empty (args, "show task pause"); check_empty (args, "show task pause");
printf_filtered ("Thread %s %s suspended while gdb has control%s.\n", gdb_printf ("Thread %s %s suspended while gdb has control%s.\n",
proc_string (thread), proc_string (thread),
sc ? "is" : "isn't", sc ? "is" : "isn't",
!sc && thread->inf->pause_sc ? " (but the task is)" : ""); !sc && thread->inf->pause_sc ? " (but the task is)" : "");
} }
static void static void
@ -3297,9 +3297,9 @@ show_thread_run_cmd (const char *args, int from_tty)
struct proc *thread = cur_thread (); struct proc *thread = cur_thread ();
check_empty (args, "show thread run"); check_empty (args, "show thread run");
printf_filtered ("Thread %s %s allowed to run.", gdb_printf ("Thread %s %s allowed to run.",
proc_string (thread), proc_string (thread),
thread->run_sc == 0 ? "is" : "isn't"); thread->run_sc == 0 ? "is" : "isn't");
} }
static void static void
@ -3315,10 +3315,10 @@ show_thread_detach_sc_cmd (const char *args, int from_tty)
struct proc *thread = cur_thread (); struct proc *thread = cur_thread ();
check_empty (args, "show thread detach-suspend-count"); check_empty (args, "show thread detach-suspend-count");
printf_filtered ("Thread %s will be left with a suspend count" gdb_printf ("Thread %s will be left with a suspend count"
" of %d when detaching.\n", " of %d when detaching.\n",
proc_string (thread), proc_string (thread),
thread->detach_sc); thread->detach_sc);
} }
static void static void
@ -3360,7 +3360,7 @@ thread_takeover_sc_cmd (const char *args, int from_tty)
error (("%s."), safe_strerror (err)); error (("%s."), safe_strerror (err));
thread->sc = info->suspend_count; thread->sc = info->suspend_count;
if (from_tty) if (from_tty)
printf_filtered ("Suspend count was %d.\n", thread->sc); gdb_printf ("Suspend count was %d.\n", thread->sc);
if (info != &_info) if (info != &_info)
vm_deallocate (mach_task_self (), (vm_address_t) info, vm_deallocate (mach_task_self (), (vm_address_t) info,
info_len * sizeof (int)); info_len * sizeof (int));

Some files were not shown because too many files have changed in this diff Show more