+2020-12-17 Tom Tromey <tromey@adacore.com>
+
+ * gdbtypes.c (print_args, dump_fn_fieldlists, print_cplus_stuff)
+ (print_gnat_stuff, print_fixed_point_type_info)
+ (recursive_dump_type): Update.
+ * go32-nat.c (go32_sysinfo, display_descriptor): Update.
+ * c-typeprint.c (c_type_print_base_struct_union)
+ (c_type_print_base_1): Update.
+ * rust-lang.c (rust_internal_print_type): Update.
+ * f-typeprint.c (f_language::f_type_print_base): Update.
+ * utils.h (fprintfi_filtered, printfi_filtered): Remove.
+ * m2-typeprint.c (m2_record_fields): Update.
+ * p-typeprint.c (pascal_type_print_base): Update.
+ * compile/compile-loc2c.c (push, pushf, unary, binary)
+ (do_compile_dwarf_expr_to_c): Update.
+ * utils.c (fprintfi_filtered, printfi_filtered): Remove.
+
2020-12-16 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_lex_tests): Update.
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
{
if (type->is_stub ())
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream, _("%*s%p[<incomplete type>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
else
- fprintfi_filtered (level + 4, stream,
- _("%p[<no data fields>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream, _("%*s%p[<no data fields>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
}
/* Start off with no specific section type, so we can print
print_spaces_filtered (2, stream);
}
- fprintfi_filtered (level, stream, "}");
+ fprintf_filtered (stream, "%*s}", level, "");
}
}
if (type->num_fields () == 0)
{
if (type->is_stub ())
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream,
+ _("%*s%p[<incomplete type>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
else
- fprintfi_filtered (level + 4, stream,
- _("%p[<no data fields>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream,
+ _("%*s%p[<no data fields>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
}
len = type->num_fields ();
for (i = 0; i < len; i++)
}
fprintf_filtered (stream, ";\n");
}
- fprintfi_filtered (level, stream, "}");
+ fprintf_filtered (stream, "%*s}", level, "");
}
}
break;
static void
push (int indent, string_file *stream, ULONGEST l)
{
- fprintfi_filtered (indent, stream,
- "__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
- hex_string (l));
+ fprintf_filtered (stream,
+ "%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
+ indent, "", hex_string (l));
}
/* Emit code to push an arbitrary expression. This works like
{
va_list args;
- fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos + 1] = ");
+ fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos + 1] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
stream->puts (";\n");
- fprintfi_filtered (indent, stream, "++__gdb_tos;\n");
+ fprintf_filtered (stream, "%*s++__gdb_tos;\n", indent, "");
}
/* Emit code for a unary expression -- one which operates in-place on
{
va_list args;
- fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos] = ");
+ fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
{
va_list args;
- fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos - 1] = ");
+ fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 1] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
stream->puts (";\n");
- fprintfi_filtered (indent, stream, "--__gdb_tos;\n");
+ fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, "");
}
/* Print the name of a label given its "SCOPE", an arbitrary integer
++scope;
- fprintfi_filtered (indent, stream, "__attribute__ ((unused)) %s %s;\n",
- type_name, result_name);
- fprintfi_filtered (indent, stream, "{\n");
+ fprintf_filtered (stream, "%*s__attribute__ ((unused)) %s %s;\n",
+ indent, "", type_name, result_name);
+ fprintf_filtered (stream, "%*s{\n", indent, "");
indent += 2;
stack_depth = compute_stack_depth (byte_order, addr_size,
"compiled code."),
sym->print_name ());
- fprintfi_filtered (indent, stream, "%s = %s;\n",
- result_name,
- core_addr_to_string (value_address (val)));
- fprintfi_filtered (indent - 2, stream, "}\n");
+ fprintf_filtered (stream, "%*s%s = %s;\n",
+ indent, "", result_name,
+ core_addr_to_string (value_address (val)));
+ fprintf_filtered (stream, "%*s}\n", indent - 2, "");
return;
}
- fprintfi_filtered (indent, stream, GCC_UINTPTR " __gdb_stack[%d];\n",
- stack_depth);
+ fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n",
+ indent, "", stack_depth);
if (need_tempvar)
- fprintfi_filtered (indent, stream, GCC_UINTPTR " __gdb_tmp;\n");
- fprintfi_filtered (indent, stream, "int __gdb_tos = -1;\n");
+ fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, "");
+ fprintf_filtered (stream, "%*sint __gdb_tos = -1;\n", indent, "");
if (initial != NULL)
pushf (indent, stream, "%s", core_addr_to_string (*initial));
break;
case DW_OP_drop:
- fprintfi_filtered (indent, stream, "--__gdb_tos;\n");
+ fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, "");
break;
case DW_OP_pick:
break;
case DW_OP_swap:
- fprintfi_filtered (indent, stream,
- "__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n");
- fprintfi_filtered (indent, stream,
- "__gdb_stack[__gdb_tos - 1] = "
- "__gdb_stack[__gdb_tos];\n");
- fprintfi_filtered (indent, stream, ("__gdb_stack[__gdb_tos] = "
- "__gdb_tmp;\n"));
+ fprintf_filtered (stream,
+ "%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n",
+ indent, "");
+ fprintf_filtered (stream,
+ "%*s__gdb_stack[__gdb_tos - 1] = "
+ "__gdb_stack[__gdb_tos];\n",
+ indent, "");
+ fprintf_filtered (stream, ("%*s__gdb_stack[__gdb_tos] = "
+ "__gdb_tmp;\n"),
+ indent, "");
break;
case DW_OP_over:
break;
case DW_OP_rot:
- fprintfi_filtered (indent, stream, ("__gdb_tmp = "
- "__gdb_stack[__gdb_tos];\n"));
- fprintfi_filtered (indent, stream,
- "__gdb_stack[__gdb_tos] = "
- "__gdb_stack[__gdb_tos - 1];\n");
- fprintfi_filtered (indent, stream,
- "__gdb_stack[__gdb_tos - 1] = "
- "__gdb_stack[__gdb_tos -2];\n");
- fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos - 2] = "
- "__gdb_tmp;\n");
+ fprintf_filtered (stream, ("%*s__gdb_tmp = "
+ "__gdb_stack[__gdb_tos];\n"),
+ indent, "");
+ fprintf_filtered (stream,
+ "%*s__gdb_stack[__gdb_tos] = "
+ "__gdb_stack[__gdb_tos - 1];\n",
+ indent, "");
+ fprintf_filtered (stream,
+ "%*s__gdb_stack[__gdb_tos - 1] = "
+ "__gdb_stack[__gdb_tos -2];\n",
+ indent, "");
+ fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 2] = "
+ "__gdb_tmp;\n",
+ indent, "");
break;
case DW_OP_deref:
/* Cast to a pointer of the desired type, then
dereference. */
- fprintfi_filtered (indent, stream,
- "__gdb_stack[__gdb_tos] = "
- "*((__gdb_int_%s *) "
- "__gdb_stack[__gdb_tos]);\n",
- mode);
+ fprintf_filtered (stream,
+ "%*s__gdb_stack[__gdb_tos] = "
+ "*((__gdb_int_%s *) "
+ "__gdb_stack[__gdb_tos]);\n",
+ indent, "", mode);
}
break;
case DW_OP_skip:
offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2;
- fprintfi_filtered (indent, stream, "goto ");
+ fprintf_filtered (stream, "%*sgoto ", indent, "");
print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n");
break;
case DW_OP_bra:
offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2;
- fprintfi_filtered (indent, stream,
- "if ((( " GCC_INTPTR
- ") __gdb_stack[__gdb_tos--]) != 0) goto ");
+ fprintf_filtered (stream,
+ "%*sif ((( " GCC_INTPTR
+ ") __gdb_stack[__gdb_tos--]) != 0) goto ",
+ indent, "");
print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n");
break;
}
}
- fprintfi_filtered (indent, stream, "%s = __gdb_stack[__gdb_tos];\n",
- result_name);
- fprintfi_filtered (indent - 2, stream, "}\n");
+ fprintf_filtered (stream, "%*s%s = __gdb_stack[__gdb_tos];\n",
+ indent, "", result_name);
+ fprintf_filtered (stream, "%*s}\n", indent - 2, "");
}
/* See compile.h. */
prefix = "Type, C_Union :: ";
else if (type->code () == TYPE_CODE_STRUCT)
prefix = "Type ";
- fprintfi_filtered (level, stream, "%s%s", prefix, type->name ());
+ fprintf_filtered (stream, "%*s%s%s", level, "", prefix, type->name ());
return;
}
break;
case TYPE_CODE_PTR:
- fprintfi_filtered (level, stream, "PTR TO -> ( ");
+ fprintf_filtered (stream, "%*sPTR TO -> ( ", level, "");
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
break;
case TYPE_CODE_REF:
- fprintfi_filtered (level, stream, "REF TO -> ( ");
+ fprintf_filtered (stream, "%*sREF TO -> ( ", level, "");
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
break;
{
gdbarch *gdbarch = get_type_arch (type);
struct type *void_type = builtin_f_type (gdbarch)->builtin_void;
- fprintfi_filtered (level, stream, "%s", void_type->name ());
+ fprintf_filtered (stream, "%*s%s", level, "", void_type->name ());
}
break;
case TYPE_CODE_UNDEF:
- fprintfi_filtered (level, stream, "struct <unknown>");
+ fprintf_filtered (stream, "%*sstruct <unknown>", level, "");
break;
case TYPE_CODE_ERROR:
- fprintfi_filtered (level, stream, "%s", TYPE_ERROR_NAME (type));
+ fprintf_filtered (stream, "%*s%s", level, "", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_RANGE:
/* This should not occur. */
- fprintfi_filtered (level, stream, "<range type>");
+ fprintf_filtered (stream, "%*s<range type>", level, "");
break;
case TYPE_CODE_CHAR:
C-oriented, we must change these to "character" from "char". */
if (strcmp (type->name (), "char") == 0)
- fprintfi_filtered (level, stream, "character");
+ fprintf_filtered (stream, "%*scharacter", level, "");
else
goto default_case;
break;
fprintf_filtered (stream, "character*%s", pulongest (upper_bound));
}
else
- fprintfi_filtered (level, stream, "character*(*)");
+ fprintf_filtered (stream, "%*scharacter*(*)", level, "");
break;
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
if (type->code () == TYPE_CODE_UNION)
- fprintfi_filtered (level, stream, "Type, C_Union :: ");
+ fprintf_filtered (stream, "%*sType, C_Union :: ", level, "");
else
- fprintfi_filtered (level, stream, "Type ");
+ fprintf_filtered (stream, "%*sType ", level, "");
fputs_filtered (type->name (), stream);
/* According to the definition,
we only print structure elements in case show > 0. */
stream, show - 1, 0, 0, 0, false);
fputs_filtered ("\n", stream);
}
- fprintfi_filtered (level, stream, "End Type ");
+ fprintf_filtered (stream, "%*sEnd Type ", level, "");
fputs_filtered (type->name (), stream);
}
break;
case TYPE_CODE_MODULE:
- fprintfi_filtered (level, stream, "module %s", type->name ());
+ fprintf_filtered (stream, "%*smodule %s", level, "", type->name ());
break;
default_case:
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
if (type->name () != NULL)
- fprintfi_filtered (level, stream, "%s", type->name ());
+ fprintf_filtered (stream, "%*s%s", level, "", type->name ());
else
error (_("Invalid type code (%d) in symbol table."), type->code ());
break;
for (i = 0; i < nargs; i++)
{
- printfi_filtered (spaces, "[%d] name '%s'\n", i,
- args[i].name != NULL ? args[i].name : "<NULL>");
+ printf_filtered ("%*s[%d] name '%s'\n", spaces, "", i,
+ args[i].name != NULL ? args[i].name : "<NULL>");
recursive_dump_type (args[i].type (), spaces + 2);
}
}
int overload_idx;
struct fn_field *f;
- printfi_filtered (spaces, "fn_fieldlists ");
+ printf_filtered ("%*sfn_fieldlists ", spaces, "");
gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
printf_filtered ("\n");
for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++)
{
f = TYPE_FN_FIELDLIST1 (type, method_idx);
- printfi_filtered (spaces + 2, "[%d] name '%s' (",
- method_idx,
- TYPE_FN_FIELDLIST_NAME (type, method_idx));
+ printf_filtered ("%*s[%d] name '%s' (", spaces + 2, "",
+ method_idx,
+ TYPE_FN_FIELDLIST_NAME (type, method_idx));
gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
gdb_stdout);
printf_filtered (_(") length %d\n"),
overload_idx < TYPE_FN_FIELDLIST_LENGTH (type, method_idx);
overload_idx++)
{
- printfi_filtered (spaces + 4, "[%d] physname '%s' (",
- overload_idx,
- TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
+ printf_filtered ("%*s[%d] physname '%s' (",
+ spaces + 4, "", overload_idx,
+ TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
gdb_stdout);
printf_filtered (")\n");
- printfi_filtered (spaces + 8, "type ");
+ printf_filtered ("%*stype ", spaces + 8, "");
gdb_print_host_address (TYPE_FN_FIELD_TYPE (f, overload_idx),
gdb_stdout);
printf_filtered ("\n");
recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx),
spaces + 8 + 2);
- printfi_filtered (spaces + 8, "args ");
+ printf_filtered ("%*sargs ", spaces + 8, "");
gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx),
gdb_stdout);
printf_filtered ("\n");
print_args (TYPE_FN_FIELD_ARGS (f, overload_idx),
TYPE_FN_FIELD_TYPE (f, overload_idx)->num_fields (),
spaces + 8 + 2);
- printfi_filtered (spaces + 8, "fcontext ");
+ printf_filtered ("%*sfcontext ", spaces + 8, "");
gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
gdb_stdout);
printf_filtered ("\n");
- printfi_filtered (spaces + 8, "is_const %d\n",
- TYPE_FN_FIELD_CONST (f, overload_idx));
- printfi_filtered (spaces + 8, "is_volatile %d\n",
- TYPE_FN_FIELD_VOLATILE (f, overload_idx));
- printfi_filtered (spaces + 8, "is_private %d\n",
- TYPE_FN_FIELD_PRIVATE (f, overload_idx));
- printfi_filtered (spaces + 8, "is_protected %d\n",
- TYPE_FN_FIELD_PROTECTED (f, overload_idx));
- printfi_filtered (spaces + 8, "is_stub %d\n",
- TYPE_FN_FIELD_STUB (f, overload_idx));
- printfi_filtered (spaces + 8, "defaulted %d\n",
- TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
- printfi_filtered (spaces + 8, "is_deleted %d\n",
- TYPE_FN_FIELD_DELETED (f, overload_idx));
- printfi_filtered (spaces + 8, "voffset %u\n",
- TYPE_FN_FIELD_VOFFSET (f, overload_idx));
+ printf_filtered ("%*sis_const %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_CONST (f, overload_idx));
+ printf_filtered ("%*sis_volatile %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_VOLATILE (f, overload_idx));
+ printf_filtered ("%*sis_private %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_PRIVATE (f, overload_idx));
+ printf_filtered ("%*sis_protected %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_PROTECTED (f, overload_idx));
+ printf_filtered ("%*sis_stub %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_STUB (f, overload_idx));
+ printf_filtered ("%*sdefaulted %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
+ printf_filtered ("%*sis_deleted %d\n", spaces + 8, "",
+ TYPE_FN_FIELD_DELETED (f, overload_idx));
+ printf_filtered ("%*svoffset %u\n", spaces + 8, "",
+ TYPE_FN_FIELD_VOFFSET (f, overload_idx));
}
}
}
static void
print_cplus_stuff (struct type *type, int spaces)
{
- printfi_filtered (spaces, "vptr_fieldno %d\n", TYPE_VPTR_FIELDNO (type));
- printfi_filtered (spaces, "vptr_basetype ");
+ printf_filtered ("%*svptr_fieldno %d\n", spaces, "",
+ TYPE_VPTR_FIELDNO (type));
+ printf_filtered ("%*svptr_basetype ", spaces, "");
gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
puts_filtered ("\n");
if (TYPE_VPTR_BASETYPE (type) != NULL)
recursive_dump_type (TYPE_VPTR_BASETYPE (type), spaces + 2);
- printfi_filtered (spaces, "n_baseclasses %d\n",
- TYPE_N_BASECLASSES (type));
- printfi_filtered (spaces, "nfn_fields %d\n",
- TYPE_NFN_FIELDS (type));
+ printf_filtered ("%*sn_baseclasses %d\n", spaces, "",
+ TYPE_N_BASECLASSES (type));
+ printf_filtered ("%*snfn_fields %d\n", spaces, "",
+ TYPE_NFN_FIELDS (type));
if (TYPE_N_BASECLASSES (type) > 0)
{
- printfi_filtered (spaces, "virtual_field_bits (%d bits at *",
- TYPE_N_BASECLASSES (type));
+ printf_filtered ("%*svirtual_field_bits (%d bits at *",
+ spaces, "", TYPE_N_BASECLASSES (type));
gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type),
gdb_stdout);
printf_filtered (")");
{
if (TYPE_FIELD_PRIVATE_BITS (type) != NULL)
{
- printfi_filtered (spaces,
- "private_field_bits (%d bits at *",
- type->num_fields ());
+ printf_filtered ("%*sprivate_field_bits (%d bits at *",
+ spaces, "", type->num_fields ());
gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type),
gdb_stdout);
printf_filtered (")");
}
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL)
{
- printfi_filtered (spaces,
- "protected_field_bits (%d bits at *",
- type->num_fields ());
+ printf_filtered ("%*sprotected_field_bits (%d bits at *",
+ spaces, "", type->num_fields ());
gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type),
gdb_stdout);
printf_filtered (")");
dump_fn_fieldlists (type, spaces);
}
- printfi_filtered (spaces, "calling_convention %d\n",
- TYPE_CPLUS_CALLING_CONVENTION (type));
+ printf_filtered ("%*scalling_convention %d\n", spaces, "",
+ TYPE_CPLUS_CALLING_CONVENTION (type));
}
/* Print the contents of the TYPE's type_specific union, assuming that
struct type *descriptive_type = TYPE_DESCRIPTIVE_TYPE (type);
if (descriptive_type == NULL)
- printfi_filtered (spaces + 2, "no descriptive type\n");
+ printf_filtered ("%*sno descriptive type\n", spaces + 2, "");
else
{
- printfi_filtered (spaces + 2, "descriptive type\n");
+ printf_filtered ("%*sdescriptive type\n", spaces + 2, "");
recursive_dump_type (descriptive_type, spaces + 4);
}
}
static void
print_fixed_point_type_info (struct type *type, int spaces)
{
- printfi_filtered (spaces + 2, "scaling factor: %s\n",
- type->fixed_point_scaling_factor ().str ().c_str ());
+ printf_filtered ("%*sscaling factor: %s\n", spaces + 2, "",
+ type->fixed_point_scaling_factor ().str ().c_str ());
}
static struct obstack dont_print_type_obstack;
{
if (type == first_dont_print[i])
{
- printfi_filtered (spaces, "type node ");
+ printf_filtered ("%*stype node ", spaces, "");
gdb_print_host_address (type, gdb_stdout);
printf_filtered (_(" <same as already seen type>\n"));
return;
obstack_ptr_grow (&dont_print_type_obstack, type);
}
- printfi_filtered (spaces, "type node ");
+ printf_filtered ("%*stype node ", spaces, "");
gdb_print_host_address (type, gdb_stdout);
printf_filtered ("\n");
- printfi_filtered (spaces, "name '%s' (",
- type->name () ? type->name () : "<NULL>");
+ printf_filtered ("%*sname '%s' (", spaces, "",
+ type->name () ? type->name () : "<NULL>");
gdb_print_host_address (type->name (), gdb_stdout);
printf_filtered (")\n");
- printfi_filtered (spaces, "code 0x%x ", type->code ());
+ printf_filtered ("%*scode 0x%x ", spaces, "", type->code ());
switch (type->code ())
{
case TYPE_CODE_UNDEF:
break;
}
puts_filtered ("\n");
- printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
+ printf_filtered ("%*slength %s\n", spaces, "",
+ pulongest (TYPE_LENGTH (type)));
if (TYPE_OBJFILE_OWNED (type))
{
- printfi_filtered (spaces, "objfile ");
+ printf_filtered ("%*sobjfile ", spaces, "");
gdb_print_host_address (TYPE_OWNER (type).objfile, gdb_stdout);
}
else
{
- printfi_filtered (spaces, "gdbarch ");
+ printf_filtered ("%*sgdbarch ", spaces, "");
gdb_print_host_address (TYPE_OWNER (type).gdbarch, gdb_stdout);
}
printf_filtered ("\n");
- printfi_filtered (spaces, "target_type ");
+ printf_filtered ("%*starget_type ", spaces, "");
gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
printf_filtered ("\n");
if (TYPE_TARGET_TYPE (type) != NULL)
{
recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2);
}
- printfi_filtered (spaces, "pointer_type ");
+ printf_filtered ("%*spointer_type ", spaces, "");
gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
printf_filtered ("\n");
- printfi_filtered (spaces, "reference_type ");
+ printf_filtered ("%*sreference_type ", spaces, "");
gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
printf_filtered ("\n");
- printfi_filtered (spaces, "type_chain ");
+ printf_filtered ("%*stype_chain ", spaces, "");
gdb_print_host_address (TYPE_CHAIN (type), gdb_stdout);
printf_filtered ("\n");
- printfi_filtered (spaces, "instance_flags 0x%x",
- (unsigned) type->instance_flags ());
+ printf_filtered ("%*sinstance_flags 0x%x", spaces, "",
+ (unsigned) type->instance_flags ());
if (TYPE_CONST (type))
{
puts_filtered (" TYPE_CONST");
}
puts_filtered ("\n");
- printfi_filtered (spaces, "flags");
+ printf_filtered ("%*sflags", spaces, "");
if (type->is_unsigned ())
{
puts_filtered (" TYPE_UNSIGNED");
puts_filtered (" TYPE_NOTTEXT");
}
puts_filtered ("\n");
- printfi_filtered (spaces, "nfields %d ", type->num_fields ());
+ printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ());
gdb_print_host_address (type->fields (), gdb_stdout);
puts_filtered ("\n");
for (idx = 0; idx < type->num_fields (); idx++)
{
if (type->code () == TYPE_CODE_ENUM)
- printfi_filtered (spaces + 2,
- "[%d] enumval %s type ",
- idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
+ printf_filtered ("%*s[%d] enumval %s type ", spaces + 2, "",
+ idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
else
- printfi_filtered (spaces + 2,
- "[%d] bitpos %s bitsize %d type ",
- idx, plongest (TYPE_FIELD_BITPOS (type, idx)),
- TYPE_FIELD_BITSIZE (type, idx));
+ printf_filtered ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "",
+ idx, plongest (TYPE_FIELD_BITPOS (type, idx)),
+ TYPE_FIELD_BITSIZE (type, idx));
gdb_print_host_address (type->field (idx).type (), gdb_stdout);
printf_filtered (" name '%s' (",
TYPE_FIELD_NAME (type, idx) != NULL
}
if (type->code () == TYPE_CODE_RANGE)
{
- printfi_filtered (spaces, "low ");
+ printf_filtered ("%*slow ", spaces, "");
dump_dynamic_prop (type->bounds ()->low);
printf_filtered (" high ");
dump_dynamic_prop (type->bounds ()->high);
switch (TYPE_SPECIFIC_FIELD (type))
{
case TYPE_SPECIFIC_CPLUS_STUFF:
- printfi_filtered (spaces, "cplus_stuff ");
+ printf_filtered ("%*scplus_stuff ", spaces, "");
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type),
gdb_stdout);
puts_filtered ("\n");
break;
case TYPE_SPECIFIC_GNAT_STUFF:
- printfi_filtered (spaces, "gnat_stuff ");
+ printf_filtered ("%*sgnat_stuff ", spaces, "");
gdb_print_host_address (TYPE_GNAT_SPECIFIC (type), gdb_stdout);
puts_filtered ("\n");
print_gnat_stuff (type, spaces);
break;
case TYPE_SPECIFIC_FLOATFORMAT:
- printfi_filtered (spaces, "floatformat ");
+ printf_filtered ("%*sfloatformat ", spaces, "");
if (TYPE_FLOATFORMAT (type) == NULL
|| TYPE_FLOATFORMAT (type)->name == NULL)
puts_filtered ("(null)");
break;
case TYPE_SPECIFIC_FUNC:
- printfi_filtered (spaces, "calling_convention %d\n",
- TYPE_CALLING_CONVENTION (type));
+ printf_filtered ("%*scalling_convention %d\n", spaces, "",
+ TYPE_CALLING_CONVENTION (type));
/* tail_call_list is not printed. */
break;
case TYPE_SPECIFIC_SELF_TYPE:
- printfi_filtered (spaces, "self_type ");
+ printf_filtered ("%*sself_type ", spaces, "");
gdb_print_host_address (TYPE_SELF_TYPE (type), gdb_stdout);
puts_filtered ("\n");
break;
case TYPE_SPECIFIC_FIXED_POINT:
- printfi_filtered (spaces, "fixed_point_info ");
+ printf_filtered ("%*sfixed_point_info ", spaces, "");
print_fixed_point_type_info (type, spaces);
puts_filtered ("\n");
break;
{
unsigned bit_size = type->bit_size ();
unsigned bit_off = type->bit_offset ();
- printfi_filtered (spaces, " bit size = %u, bit offset = %u\n",
- bit_size, bit_off);
+ printf_filtered ("%*s bit size = %u, bit offset = %u\n", spaces, "",
+ bit_size, bit_off);
}
break;
}
xsnprintf (cpu_string, sizeof (cpu_string), "%s%s Model %d Stepping %d",
intel_p ? "Pentium" : (amd_p ? "AMD" : (hygon_p ? "Hygon" : "ix86")),
cpu_brand, cpu_model, cpuid_eax & 0xf);
- printfi_filtered (31, "%s\n", cpu_string);
+ printf_filtered ("%*s%s\n", 31, "", cpu_string);
if (((cpuid_edx & (6 | (0x0d << 23))) != 0)
|| ((cpuid_edx & 1) == 0)
|| ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 0))
"%s-bit DPMI, with%s Virtual Memory support\n",
(dpmi_version_data.flags & 1) ? "32" : "16",
(dpmi_version_data.flags & 4) ? "" : "out");
- printfi_filtered (31, "Interrupts reflected to %s mode\n",
+ printf_filtered ("%*sInterrupts reflected to %s mode\n", 31, "",
(dpmi_version_data.flags & 2) ? "V86" : "Real");
- printfi_filtered (31, "Processor type: i%d86\n",
+ printf_filtered ("%*sProcessor type: i%d86\n", 31, "",
dpmi_version_data.cpu);
- printfi_filtered (31, "PIC base interrupt: Master: %#x Slave: %#x\n",
+ printf_filtered ("%*sPIC base interrupt: Master: %#x Slave: %#x\n", 31, "",
dpmi_version_data.master_pic, dpmi_version_data.slave_pic);
/* a_tss is only initialized when the debuggee is first run. */
__dpmi_int (0x21, ®s);
if ((regs.x.flags & 1) != 0)
regs.h.al = 0;
- printfi_filtered (31, "UMBs %sin DOS memory chain\n",
- regs.h.al == 0 ? "not " : "");
+ printf_filtered ("%*sUMBs %sin DOS memory chain\n", 31, "",
+ regs.h.al == 0 ? "not " : "");
}
}
break;
case 5:
printf_filtered ("TSS selector=0x%04x", descr.base0);
- printfi_filtered (16, "Task Gate");
+ printf_filtered ("%*sTask Gate", 16, "");
break;
case 6:
case 7:
fprintf_filtered (stream, ";\n");
}
- fprintfi_filtered (level, stream, "END ");
+ fprintf_filtered (stream, "%*sEND ", level, "");
}
}
if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
if (type->is_stub ())
- fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
+ fprintf_filtered (stream, "%*s<incomplete type>\n",
+ level + 4, "");
else
- fprintfi_filtered (level + 4, stream, "<no data fields>\n");
+ fprintf_filtered (stream, "%*s<no data fields>\n",
+ level + 4, "");
}
/* Start off with no specific section type, so we can print
if (section_type != s_protected)
{
section_type = s_protected;
- fprintfi_filtered (level + 2, stream,
- "protected\n");
+ fprintf_filtered (stream, "%*sprotected\n",
+ level + 2, "");
}
}
else if (TYPE_FIELD_PRIVATE (type, i))
if (section_type != s_private)
{
section_type = s_private;
- fprintfi_filtered (level + 2, stream, "private\n");
+ fprintf_filtered (stream, "%*sprivate\n",
+ level + 2, "");
}
}
else
if (section_type != s_public)
{
section_type = s_public;
- fprintfi_filtered (level + 2, stream, "public\n");
+ fprintf_filtered (stream, "%*spublic\n",
+ level + 2, "");
}
}
}
if (section_type != s_protected)
{
section_type = s_protected;
- fprintfi_filtered (level + 2, stream,
- "protected\n");
+ fprintf_filtered (stream, "%*sprotected\n",
+ level + 2, "");
}
}
else if (TYPE_FN_FIELD_PRIVATE (f, j))
if (section_type != s_private)
{
section_type = s_private;
- fprintfi_filtered (level + 2, stream, "private\n");
+ fprintf_filtered (stream, "%*sprivate\n",
+ level + 2, "");
}
}
else
if (section_type != s_public)
{
section_type = s_public;
- fprintfi_filtered (level + 2, stream, "public\n");
+ fprintf_filtered (stream, "%*spublic\n",
+ level + 2, "");
}
}
fprintf_filtered (stream, ";\n");
}
}
- fprintfi_filtered (level, stream, "end");
+ fprintf_filtered (stream, "%*send", level, "");
}
break;
&& name[len] == ':'
&& name[len + 1] == ':')
name += len + 2;
- fprintfi_filtered (level + 2, stream, "%ps,\n",
- styled_string (variable_name_style.style (),
- name));
+ fprintf_filtered (stream, "%*s%ps,\n",
+ level + 2, "",
+ styled_string (variable_name_style.style (),
+ name));
}
fputs_filtered ("}", stream);
va_end (args);
}
-/* Like fprintf_filtered, but prints its result indented.
- Called as fprintfi_filtered (spaces, stream, format, ...); */
-
-void
-fprintfi_filtered (int spaces, struct ui_file *stream, const char *format,
- ...)
-{
- va_list args;
-
- va_start (args, format);
- print_spaces_filtered (spaces, stream);
-
- vfprintf_filtered (stream, format, args);
- va_end (args);
-}
-
/* See utils.h. */
void
va_end (args);
}
-/* Like printf_filtered, but prints it's result indented.
- Called as printfi_filtered (spaces, format, ...); */
-
-void
-printfi_filtered (int spaces, const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- print_spaces_filtered (spaces, gdb_stdout);
- vfprintf_filtered (gdb_stdout, format, args);
- va_end (args);
-}
-
/* Easy -- but watch out!
This routine is *not* a replacement for puts()! puts() appends a newline.
extern void fprintf_filtered (struct ui_file *, const char *, ...)
ATTRIBUTE_PRINTF (2, 3);
-extern void fprintfi_filtered (int, struct ui_file *, const char *, ...)
- ATTRIBUTE_PRINTF (3, 4);
-
extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
-
extern void vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)