mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
Remove printfi_filtered and fprintfi_filtered
After seeing Simon's patch, I thought maybe it was finally time to remove printfi_filtered and fprintfi_filtered, in favor of using the "%*s" approach to indenting. In this patch I took the straightforward approach of always adding a leading "%*s", even when the format already started with "%s", to avoid the trickier form of: printf ("%*s", -indent, string) Regression tested on x86-64 Fedora 32. Let me know what you think. gdb/ChangeLog 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.
This commit is contained in:
@ -1,3 +1,20 @@
|
|||||||
|
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>
|
2020-12-16 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* rust-exp.y (rust_lex_tests): Update.
|
* rust-exp.y (rust_lex_tests): Update.
|
||||||
|
@ -1122,12 +1122,12 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
|
|||||||
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
|
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
|
||||||
{
|
{
|
||||||
if (type->is_stub ())
|
if (type->is_stub ())
|
||||||
fprintfi_filtered (level + 4, stream,
|
fprintf_filtered (stream, _("%*s%p[<incomplete type>%p]\n"),
|
||||||
_("%p[<incomplete type>%p]\n"),
|
level + 4, "",
|
||||||
metadata_style.style ().ptr (), nullptr);
|
metadata_style.style ().ptr (), nullptr);
|
||||||
else
|
else
|
||||||
fprintfi_filtered (level + 4, stream,
|
fprintf_filtered (stream, _("%*s%p[<no data fields>%p]\n"),
|
||||||
_("%p[<no data fields>%p]\n"),
|
level + 4, "",
|
||||||
metadata_style.style ().ptr (), nullptr);
|
metadata_style.style ().ptr (), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1439,7 +1439,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
|
|||||||
print_spaces_filtered (2, stream);
|
print_spaces_filtered (2, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintfi_filtered (level, stream, "}");
|
fprintf_filtered (stream, "%*s}", level, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1633,12 +1633,14 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
|||||||
if (type->num_fields () == 0)
|
if (type->num_fields () == 0)
|
||||||
{
|
{
|
||||||
if (type->is_stub ())
|
if (type->is_stub ())
|
||||||
fprintfi_filtered (level + 4, stream,
|
fprintf_filtered (stream,
|
||||||
_("%p[<incomplete type>%p]\n"),
|
_("%*s%p[<incomplete type>%p]\n"),
|
||||||
|
level + 4, "",
|
||||||
metadata_style.style ().ptr (), nullptr);
|
metadata_style.style ().ptr (), nullptr);
|
||||||
else
|
else
|
||||||
fprintfi_filtered (level + 4, stream,
|
fprintf_filtered (stream,
|
||||||
_("%p[<no data fields>%p]\n"),
|
_("%*s%p[<no data fields>%p]\n"),
|
||||||
|
level + 4, "",
|
||||||
metadata_style.style ().ptr (), nullptr);
|
metadata_style.style ().ptr (), nullptr);
|
||||||
}
|
}
|
||||||
len = type->num_fields ();
|
len = type->num_fields ();
|
||||||
@ -1663,7 +1665,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
|||||||
}
|
}
|
||||||
fprintf_filtered (stream, ";\n");
|
fprintf_filtered (stream, ";\n");
|
||||||
}
|
}
|
||||||
fprintfi_filtered (level, stream, "}");
|
fprintf_filtered (stream, "%*s}", level, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -434,9 +434,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)
|
||||||
{
|
{
|
||||||
fprintfi_filtered (indent, stream,
|
fprintf_filtered (stream,
|
||||||
"__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
|
"%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
|
||||||
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
|
||||||
@ -450,13 +450,13 @@ pushf (int indent, string_file *stream, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list 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);
|
va_start (args, format);
|
||||||
stream->vprintf (format, args);
|
stream->vprintf (format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
stream->puts (";\n");
|
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
|
/* Emit code for a unary expression -- one which operates in-place on
|
||||||
@ -470,7 +470,7 @@ unary (int indent, string_file *stream, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos] = ");
|
fprintf_filtered (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);
|
||||||
@ -487,12 +487,12 @@ binary (int indent, string_file *stream, const char *format, ...)
|
|||||||
{
|
{
|
||||||
va_list 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);
|
va_start (args, format);
|
||||||
stream->vprintf (format, args);
|
stream->vprintf (format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
stream->puts (";\n");
|
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
|
/* Print the name of a label given its "SCOPE", an arbitrary integer
|
||||||
@ -599,9 +599,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
|
|
||||||
++scope;
|
++scope;
|
||||||
|
|
||||||
fprintfi_filtered (indent, stream, "__attribute__ ((unused)) %s %s;\n",
|
fprintf_filtered (stream, "%*s__attribute__ ((unused)) %s %s;\n",
|
||||||
type_name, result_name);
|
indent, "", type_name, result_name);
|
||||||
fprintfi_filtered (indent, stream, "{\n");
|
fprintf_filtered (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,
|
||||||
@ -637,19 +637,19 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
"compiled code."),
|
"compiled code."),
|
||||||
sym->print_name ());
|
sym->print_name ());
|
||||||
|
|
||||||
fprintfi_filtered (indent, stream, "%s = %s;\n",
|
fprintf_filtered (stream, "%*s%s = %s;\n",
|
||||||
result_name,
|
indent, "", result_name,
|
||||||
core_addr_to_string (value_address (val)));
|
core_addr_to_string (value_address (val)));
|
||||||
fprintfi_filtered (indent - 2, stream, "}\n");
|
fprintf_filtered (stream, "%*s}\n", indent - 2, "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintfi_filtered (indent, stream, GCC_UINTPTR " __gdb_stack[%d];\n",
|
fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n",
|
||||||
stack_depth);
|
indent, "", stack_depth);
|
||||||
|
|
||||||
if (need_tempvar)
|
if (need_tempvar)
|
||||||
fprintfi_filtered (indent, stream, GCC_UINTPTR " __gdb_tmp;\n");
|
fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, "");
|
||||||
fprintfi_filtered (indent, stream, "int __gdb_tos = -1;\n");
|
fprintf_filtered (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));
|
||||||
@ -908,7 +908,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_drop:
|
case DW_OP_drop:
|
||||||
fprintfi_filtered (indent, stream, "--__gdb_tos;\n");
|
fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_pick:
|
case DW_OP_pick:
|
||||||
@ -918,13 +918,16 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_swap:
|
case DW_OP_swap:
|
||||||
fprintfi_filtered (indent, stream,
|
fprintf_filtered (stream,
|
||||||
"__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n");
|
"%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n",
|
||||||
fprintfi_filtered (indent, stream,
|
indent, "");
|
||||||
"__gdb_stack[__gdb_tos - 1] = "
|
fprintf_filtered (stream,
|
||||||
"__gdb_stack[__gdb_tos];\n");
|
"%*s__gdb_stack[__gdb_tos - 1] = "
|
||||||
fprintfi_filtered (indent, stream, ("__gdb_stack[__gdb_tos] = "
|
"__gdb_stack[__gdb_tos];\n",
|
||||||
"__gdb_tmp;\n"));
|
indent, "");
|
||||||
|
fprintf_filtered (stream, ("%*s__gdb_stack[__gdb_tos] = "
|
||||||
|
"__gdb_tmp;\n"),
|
||||||
|
indent, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_over:
|
case DW_OP_over:
|
||||||
@ -932,16 +935,20 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_rot:
|
case DW_OP_rot:
|
||||||
fprintfi_filtered (indent, stream, ("__gdb_tmp = "
|
fprintf_filtered (stream, ("%*s__gdb_tmp = "
|
||||||
"__gdb_stack[__gdb_tos];\n"));
|
"__gdb_stack[__gdb_tos];\n"),
|
||||||
fprintfi_filtered (indent, stream,
|
indent, "");
|
||||||
"__gdb_stack[__gdb_tos] = "
|
fprintf_filtered (stream,
|
||||||
"__gdb_stack[__gdb_tos - 1];\n");
|
"%*s__gdb_stack[__gdb_tos] = "
|
||||||
fprintfi_filtered (indent, stream,
|
"__gdb_stack[__gdb_tos - 1];\n",
|
||||||
"__gdb_stack[__gdb_tos - 1] = "
|
indent, "");
|
||||||
"__gdb_stack[__gdb_tos -2];\n");
|
fprintf_filtered (stream,
|
||||||
fprintfi_filtered (indent, stream, "__gdb_stack[__gdb_tos - 2] = "
|
"%*s__gdb_stack[__gdb_tos - 1] = "
|
||||||
"__gdb_tmp;\n");
|
"__gdb_stack[__gdb_tos -2];\n",
|
||||||
|
indent, "");
|
||||||
|
fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 2] = "
|
||||||
|
"__gdb_tmp;\n",
|
||||||
|
indent, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_deref:
|
case DW_OP_deref:
|
||||||
@ -962,11 +969,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. */
|
||||||
fprintfi_filtered (indent, stream,
|
fprintf_filtered (stream,
|
||||||
"__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",
|
||||||
mode);
|
indent, "", mode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1088,7 +1095,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;
|
||||||
fprintfi_filtered (indent, stream, "goto ");
|
fprintf_filtered (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;
|
||||||
@ -1096,9 +1103,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;
|
||||||
fprintfi_filtered (indent, stream,
|
fprintf_filtered (stream,
|
||||||
"if ((( " GCC_INTPTR
|
"%*sif ((( " GCC_INTPTR
|
||||||
") __gdb_stack[__gdb_tos--]) != 0) goto ");
|
") __gdb_stack[__gdb_tos--]) != 0) goto ",
|
||||||
|
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;
|
||||||
@ -1111,9 +1119,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintfi_filtered (indent, stream, "%s = __gdb_stack[__gdb_tos];\n",
|
fprintf_filtered (stream, "%*s%s = __gdb_stack[__gdb_tos];\n",
|
||||||
result_name);
|
indent, "", result_name);
|
||||||
fprintfi_filtered (indent - 2, stream, "}\n");
|
fprintf_filtered (stream, "%*s}\n", indent - 2, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See compile.h. */
|
/* See compile.h. */
|
||||||
|
@ -307,7 +307,7 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
|
|||||||
prefix = "Type, C_Union :: ";
|
prefix = "Type, C_Union :: ";
|
||||||
else if (type->code () == TYPE_CODE_STRUCT)
|
else if (type->code () == TYPE_CODE_STRUCT)
|
||||||
prefix = "Type ";
|
prefix = "Type ";
|
||||||
fprintfi_filtered (level, stream, "%s%s", prefix, type->name ());
|
fprintf_filtered (stream, "%*s%s%s", level, "", prefix, type->name ());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,12 +331,12 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_PTR:
|
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);
|
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_REF:
|
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);
|
f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -344,21 +344,21 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
|
|||||||
{
|
{
|
||||||
gdbarch *gdbarch = get_type_arch (type);
|
gdbarch *gdbarch = get_type_arch (type);
|
||||||
struct type *void_type = builtin_f_type (gdbarch)->builtin_void;
|
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;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_UNDEF:
|
case TYPE_CODE_UNDEF:
|
||||||
fprintfi_filtered (level, stream, "struct <unknown>");
|
fprintf_filtered (stream, "%*sstruct <unknown>", level, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_ERROR:
|
case TYPE_CODE_ERROR:
|
||||||
fprintfi_filtered (level, stream, "%s", TYPE_ERROR_NAME (type));
|
fprintf_filtered (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. */
|
||||||
fprintfi_filtered (level, stream, "<range type>");
|
fprintf_filtered (stream, "%*s<range type>", level, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_CHAR:
|
case TYPE_CODE_CHAR:
|
||||||
@ -368,7 +368,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)
|
||||||
fprintfi_filtered (level, stream, "character");
|
fprintf_filtered (stream, "%*scharacter", level, "");
|
||||||
else
|
else
|
||||||
goto default_case;
|
goto default_case;
|
||||||
break;
|
break;
|
||||||
@ -387,15 +387,15 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
|
|||||||
fprintf_filtered (stream, "character*%s", pulongest (upper_bound));
|
fprintf_filtered (stream, "character*%s", pulongest (upper_bound));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintfi_filtered (level, stream, "character*(*)");
|
fprintf_filtered (stream, "%*scharacter*(*)", level, "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_STRUCT:
|
case TYPE_CODE_STRUCT:
|
||||||
case TYPE_CODE_UNION:
|
case TYPE_CODE_UNION:
|
||||||
if (type->code () == TYPE_CODE_UNION)
|
if (type->code () == TYPE_CODE_UNION)
|
||||||
fprintfi_filtered (level, stream, "Type, C_Union :: ");
|
fprintf_filtered (stream, "%*sType, C_Union :: ", level, "");
|
||||||
else
|
else
|
||||||
fprintfi_filtered (level, stream, "Type ");
|
fprintf_filtered (stream, "%*sType ", level, "");
|
||||||
fputs_filtered (type->name (), stream);
|
fputs_filtered (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. */
|
||||||
@ -413,13 +413,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);
|
||||||
fputs_filtered ("\n", stream);
|
fputs_filtered ("\n", stream);
|
||||||
}
|
}
|
||||||
fprintfi_filtered (level, stream, "End Type ");
|
fprintf_filtered (stream, "%*sEnd Type ", level, "");
|
||||||
fputs_filtered (type->name (), stream);
|
fputs_filtered (type->name (), stream);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_MODULE:
|
case TYPE_CODE_MODULE:
|
||||||
fprintfi_filtered (level, stream, "module %s", type->name ());
|
fprintf_filtered (stream, "%*smodule %s", level, "", type->name ());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default_case:
|
default_case:
|
||||||
@ -429,7 +429,7 @@ 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)
|
||||||
fprintfi_filtered (level, stream, "%s", type->name ());
|
fprintf_filtered (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;
|
||||||
|
114
gdb/gdbtypes.c
114
gdb/gdbtypes.c
@ -4829,7 +4829,7 @@ print_args (struct field *args, int nargs, int spaces)
|
|||||||
|
|
||||||
for (i = 0; i < nargs; i++)
|
for (i = 0; i < nargs; i++)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "[%d] name '%s'\n", i,
|
printf_filtered ("%*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);
|
||||||
}
|
}
|
||||||
@ -4855,13 +4855,13 @@ dump_fn_fieldlists (struct type *type, int spaces)
|
|||||||
int overload_idx;
|
int overload_idx;
|
||||||
struct fn_field *f;
|
struct fn_field *f;
|
||||||
|
|
||||||
printfi_filtered (spaces, "fn_fieldlists ");
|
printf_filtered ("%*sfn_fieldlists ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
|
gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
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);
|
||||||
printfi_filtered (spaces + 2, "[%d] name '%s' (",
|
printf_filtered ("%*s[%d] name '%s' (", spaces + 2, "",
|
||||||
method_idx,
|
method_idx,
|
||||||
TYPE_FN_FIELDLIST_NAME (type, method_idx));
|
TYPE_FN_FIELDLIST_NAME (type, method_idx));
|
||||||
gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
|
gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
|
||||||
@ -4872,13 +4872,13 @@ 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++)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces + 4, "[%d] physname '%s' (",
|
printf_filtered ("%*s[%d] physname '%s' (",
|
||||||
overload_idx,
|
spaces + 4, "", overload_idx,
|
||||||
TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
|
TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
|
||||||
gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
|
gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered (")\n");
|
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_print_host_address (TYPE_FN_FIELD_TYPE (f, overload_idx),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
@ -4886,33 +4886,33 @@ dump_fn_fieldlists (struct type *type, int spaces)
|
|||||||
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);
|
||||||
|
|
||||||
printfi_filtered (spaces + 8, "args ");
|
printf_filtered ("%*sargs ", spaces + 8, "");
|
||||||
gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx),
|
gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
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);
|
||||||
printfi_filtered (spaces + 8, "fcontext ");
|
printf_filtered ("%*sfcontext ", spaces + 8, "");
|
||||||
gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
|
gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
|
|
||||||
printfi_filtered (spaces + 8, "is_const %d\n",
|
printf_filtered ("%*sis_const %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_CONST (f, overload_idx));
|
TYPE_FN_FIELD_CONST (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "is_volatile %d\n",
|
printf_filtered ("%*sis_volatile %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_VOLATILE (f, overload_idx));
|
TYPE_FN_FIELD_VOLATILE (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "is_private %d\n",
|
printf_filtered ("%*sis_private %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_PRIVATE (f, overload_idx));
|
TYPE_FN_FIELD_PRIVATE (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "is_protected %d\n",
|
printf_filtered ("%*sis_protected %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_PROTECTED (f, overload_idx));
|
TYPE_FN_FIELD_PROTECTED (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "is_stub %d\n",
|
printf_filtered ("%*sis_stub %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_STUB (f, overload_idx));
|
TYPE_FN_FIELD_STUB (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "defaulted %d\n",
|
printf_filtered ("%*sdefaulted %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
|
TYPE_FN_FIELD_DEFAULTED (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "is_deleted %d\n",
|
printf_filtered ("%*sis_deleted %d\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_DELETED (f, overload_idx));
|
TYPE_FN_FIELD_DELETED (f, overload_idx));
|
||||||
printfi_filtered (spaces + 8, "voffset %u\n",
|
printf_filtered ("%*svoffset %u\n", spaces + 8, "",
|
||||||
TYPE_FN_FIELD_VOFFSET (f, overload_idx));
|
TYPE_FN_FIELD_VOFFSET (f, overload_idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4921,21 +4921,22 @@ 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)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "vptr_fieldno %d\n", TYPE_VPTR_FIELDNO (type));
|
printf_filtered ("%*svptr_fieldno %d\n", spaces, "",
|
||||||
printfi_filtered (spaces, "vptr_basetype ");
|
TYPE_VPTR_FIELDNO (type));
|
||||||
|
printf_filtered ("%*svptr_basetype ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
|
gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
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);
|
||||||
|
|
||||||
printfi_filtered (spaces, "n_baseclasses %d\n",
|
printf_filtered ("%*sn_baseclasses %d\n", spaces, "",
|
||||||
TYPE_N_BASECLASSES (type));
|
TYPE_N_BASECLASSES (type));
|
||||||
printfi_filtered (spaces, "nfn_fields %d\n",
|
printf_filtered ("%*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)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "virtual_field_bits (%d bits at *",
|
printf_filtered ("%*svirtual_field_bits (%d bits at *",
|
||||||
TYPE_N_BASECLASSES (type));
|
spaces, "", TYPE_N_BASECLASSES (type));
|
||||||
gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type),
|
gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered (")");
|
printf_filtered (")");
|
||||||
@ -4948,9 +4949,8 @@ print_cplus_stuff (struct type *type, int spaces)
|
|||||||
{
|
{
|
||||||
if (TYPE_FIELD_PRIVATE_BITS (type) != NULL)
|
if (TYPE_FIELD_PRIVATE_BITS (type) != NULL)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces,
|
printf_filtered ("%*sprivate_field_bits (%d bits at *",
|
||||||
"private_field_bits (%d bits at *",
|
spaces, "", type->num_fields ());
|
||||||
type->num_fields ());
|
|
||||||
gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type),
|
gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered (")");
|
printf_filtered (")");
|
||||||
@ -4960,9 +4960,8 @@ print_cplus_stuff (struct type *type, int spaces)
|
|||||||
}
|
}
|
||||||
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL)
|
if (TYPE_FIELD_PROTECTED_BITS (type) != NULL)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces,
|
printf_filtered ("%*sprotected_field_bits (%d bits at *",
|
||||||
"protected_field_bits (%d bits at *",
|
spaces, "", type->num_fields ());
|
||||||
type->num_fields ());
|
|
||||||
gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type),
|
gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
printf_filtered (")");
|
printf_filtered (")");
|
||||||
@ -4976,7 +4975,7 @@ print_cplus_stuff (struct type *type, int spaces)
|
|||||||
dump_fn_fieldlists (type, spaces);
|
dump_fn_fieldlists (type, spaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
printfi_filtered (spaces, "calling_convention %d\n",
|
printf_filtered ("%*scalling_convention %d\n", spaces, "",
|
||||||
TYPE_CPLUS_CALLING_CONVENTION (type));
|
TYPE_CPLUS_CALLING_CONVENTION (type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4989,10 +4988,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)
|
||||||
printfi_filtered (spaces + 2, "no descriptive type\n");
|
printf_filtered ("%*sno descriptive type\n", spaces + 2, "");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces + 2, "descriptive type\n");
|
printf_filtered ("%*sdescriptive type\n", spaces + 2, "");
|
||||||
recursive_dump_type (descriptive_type, spaces + 4);
|
recursive_dump_type (descriptive_type, spaces + 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5003,7 +5002,7 @@ 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)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces + 2, "scaling factor: %s\n",
|
printf_filtered ("%*sscaling factor: %s\n", spaces + 2, "",
|
||||||
type->fixed_point_scaling_factor ().str ().c_str ());
|
type->fixed_point_scaling_factor ().str ().c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5053,7 +5052,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
{
|
{
|
||||||
if (type == first_dont_print[i])
|
if (type == first_dont_print[i])
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "type node ");
|
printf_filtered ("%*stype node ", spaces, "");
|
||||||
gdb_print_host_address (type, gdb_stdout);
|
gdb_print_host_address (type, gdb_stdout);
|
||||||
printf_filtered (_(" <same as already seen type>\n"));
|
printf_filtered (_(" <same as already seen type>\n"));
|
||||||
return;
|
return;
|
||||||
@ -5063,14 +5062,14 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
obstack_ptr_grow (&dont_print_type_obstack, type);
|
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);
|
gdb_print_host_address (type, gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printfi_filtered (spaces, "name '%s' (",
|
printf_filtered ("%*sname '%s' (", spaces, "",
|
||||||
type->name () ? type->name () : "<NULL>");
|
type->name () ? type->name () : "<NULL>");
|
||||||
gdb_print_host_address (type->name (), gdb_stdout);
|
gdb_print_host_address (type->name (), gdb_stdout);
|
||||||
printf_filtered (")\n");
|
printf_filtered (")\n");
|
||||||
printfi_filtered (spaces, "code 0x%x ", type->code ());
|
printf_filtered ("%*scode 0x%x ", spaces, "", type->code ());
|
||||||
switch (type->code ())
|
switch (type->code ())
|
||||||
{
|
{
|
||||||
case TYPE_CODE_UNDEF:
|
case TYPE_CODE_UNDEF:
|
||||||
@ -5153,35 +5152,36 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
puts_filtered ("\n");
|
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))
|
if (TYPE_OBJFILE_OWNED (type))
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "objfile ");
|
printf_filtered ("%*sobjfile ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_OWNER (type).objfile, gdb_stdout);
|
gdb_print_host_address (TYPE_OWNER (type).objfile, gdb_stdout);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "gdbarch ");
|
printf_filtered ("%*sgdbarch ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_OWNER (type).gdbarch, gdb_stdout);
|
gdb_print_host_address (TYPE_OWNER (type).gdbarch, gdb_stdout);
|
||||||
}
|
}
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printfi_filtered (spaces, "target_type ");
|
printf_filtered ("%*starget_type ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
|
gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
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);
|
||||||
}
|
}
|
||||||
printfi_filtered (spaces, "pointer_type ");
|
printf_filtered ("%*spointer_type ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
|
gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printfi_filtered (spaces, "reference_type ");
|
printf_filtered ("%*sreference_type ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
|
gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printfi_filtered (spaces, "type_chain ");
|
printf_filtered ("%*stype_chain ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_CHAIN (type), gdb_stdout);
|
gdb_print_host_address (TYPE_CHAIN (type), gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printfi_filtered (spaces, "instance_flags 0x%x",
|
printf_filtered ("%*sinstance_flags 0x%x", spaces, "",
|
||||||
(unsigned) type->instance_flags ());
|
(unsigned) type->instance_flags ());
|
||||||
if (TYPE_CONST (type))
|
if (TYPE_CONST (type))
|
||||||
{
|
{
|
||||||
@ -5217,7 +5217,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
}
|
}
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
|
|
||||||
printfi_filtered (spaces, "flags");
|
printf_filtered ("%*sflags", spaces, "");
|
||||||
if (type->is_unsigned ())
|
if (type->is_unsigned ())
|
||||||
{
|
{
|
||||||
puts_filtered (" TYPE_UNSIGNED");
|
puts_filtered (" TYPE_UNSIGNED");
|
||||||
@ -5266,18 +5266,16 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
puts_filtered (" TYPE_NOTTEXT");
|
puts_filtered (" TYPE_NOTTEXT");
|
||||||
}
|
}
|
||||||
puts_filtered ("\n");
|
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);
|
gdb_print_host_address (type->fields (), gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
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)
|
||||||
printfi_filtered (spaces + 2,
|
printf_filtered ("%*s[%d] enumval %s type ", spaces + 2, "",
|
||||||
"[%d] enumval %s type ",
|
|
||||||
idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
|
idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
|
||||||
else
|
else
|
||||||
printfi_filtered (spaces + 2,
|
printf_filtered ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "",
|
||||||
"[%d] bitpos %s bitsize %d type ",
|
|
||||||
idx, plongest (TYPE_FIELD_BITPOS (type, idx)),
|
idx, plongest (TYPE_FIELD_BITPOS (type, idx)),
|
||||||
TYPE_FIELD_BITSIZE (type, idx));
|
TYPE_FIELD_BITSIZE (type, idx));
|
||||||
gdb_print_host_address (type->field (idx).type (), gdb_stdout);
|
gdb_print_host_address (type->field (idx).type (), gdb_stdout);
|
||||||
@ -5294,7 +5292,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
}
|
}
|
||||||
if (type->code () == TYPE_CODE_RANGE)
|
if (type->code () == TYPE_CODE_RANGE)
|
||||||
{
|
{
|
||||||
printfi_filtered (spaces, "low ");
|
printf_filtered ("%*slow ", spaces, "");
|
||||||
dump_dynamic_prop (type->bounds ()->low);
|
dump_dynamic_prop (type->bounds ()->low);
|
||||||
printf_filtered (" high ");
|
printf_filtered (" high ");
|
||||||
dump_dynamic_prop (type->bounds ()->high);
|
dump_dynamic_prop (type->bounds ()->high);
|
||||||
@ -5304,7 +5302,7 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
switch (TYPE_SPECIFIC_FIELD (type))
|
switch (TYPE_SPECIFIC_FIELD (type))
|
||||||
{
|
{
|
||||||
case TYPE_SPECIFIC_CPLUS_STUFF:
|
case TYPE_SPECIFIC_CPLUS_STUFF:
|
||||||
printfi_filtered (spaces, "cplus_stuff ");
|
printf_filtered ("%*scplus_stuff ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type),
|
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type),
|
||||||
gdb_stdout);
|
gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
@ -5312,14 +5310,14 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_SPECIFIC_GNAT_STUFF:
|
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);
|
gdb_print_host_address (TYPE_GNAT_SPECIFIC (type), gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
print_gnat_stuff (type, spaces);
|
print_gnat_stuff (type, spaces);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_SPECIFIC_FLOATFORMAT:
|
case TYPE_SPECIFIC_FLOATFORMAT:
|
||||||
printfi_filtered (spaces, "floatformat ");
|
printf_filtered ("%*sfloatformat ", spaces, "");
|
||||||
if (TYPE_FLOATFORMAT (type) == NULL
|
if (TYPE_FLOATFORMAT (type) == NULL
|
||||||
|| TYPE_FLOATFORMAT (type)->name == NULL)
|
|| TYPE_FLOATFORMAT (type)->name == NULL)
|
||||||
puts_filtered ("(null)");
|
puts_filtered ("(null)");
|
||||||
@ -5329,19 +5327,19 @@ recursive_dump_type (struct type *type, int spaces)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_SPECIFIC_FUNC:
|
case TYPE_SPECIFIC_FUNC:
|
||||||
printfi_filtered (spaces, "calling_convention %d\n",
|
printf_filtered ("%*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:
|
||||||
printfi_filtered (spaces, "self_type ");
|
printf_filtered ("%*sself_type ", spaces, "");
|
||||||
gdb_print_host_address (TYPE_SELF_TYPE (type), gdb_stdout);
|
gdb_print_host_address (TYPE_SELF_TYPE (type), gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_SPECIFIC_FIXED_POINT:
|
case TYPE_SPECIFIC_FIXED_POINT:
|
||||||
printfi_filtered (spaces, "fixed_point_info ");
|
printf_filtered ("%*sfixed_point_info ", spaces, "");
|
||||||
print_fixed_point_type_info (type, spaces);
|
print_fixed_point_type_info (type, spaces);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
break;
|
break;
|
||||||
@ -5351,7 +5349,7 @@ 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 ();
|
||||||
printfi_filtered (spaces, " bit size = %u, bit offset = %u\n",
|
printf_filtered ("%*s bit size = %u, bit offset = %u\n", spaces, "",
|
||||||
bit_size, bit_off);
|
bit_size, bit_off);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1261,7 +1261,7 @@ go32_sysinfo (const char *arg, int from_tty)
|
|||||||
xsnprintf (cpu_string, sizeof (cpu_string), "%s%s Model %d Stepping %d",
|
xsnprintf (cpu_string, sizeof (cpu_string), "%s%s Model %d Stepping %d",
|
||||||
intel_p ? "Pentium" : (amd_p ? "AMD" : (hygon_p ? "Hygon" : "ix86")),
|
intel_p ? "Pentium" : (amd_p ? "AMD" : (hygon_p ? "Hygon" : "ix86")),
|
||||||
cpu_brand, cpu_model, cpuid_eax & 0xf);
|
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)
|
if (((cpuid_edx & (6 | (0x0d << 23))) != 0)
|
||||||
|| ((cpuid_edx & 1) == 0)
|
|| ((cpuid_edx & 1) == 0)
|
||||||
|| ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 0))
|
|| ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 0))
|
||||||
@ -1372,11 +1372,11 @@ go32_sysinfo (const char *arg, int from_tty)
|
|||||||
"%s-bit DPMI, with%s Virtual Memory support\n",
|
"%s-bit DPMI, with%s Virtual Memory support\n",
|
||||||
(dpmi_version_data.flags & 1) ? "32" : "16",
|
(dpmi_version_data.flags & 1) ? "32" : "16",
|
||||||
(dpmi_version_data.flags & 4) ? "" : "out");
|
(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");
|
(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);
|
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);
|
dpmi_version_data.master_pic, dpmi_version_data.slave_pic);
|
||||||
|
|
||||||
/* a_tss is only initialized when the debuggee is first run. */
|
/* a_tss is only initialized when the debuggee is first run. */
|
||||||
@ -1430,7 +1430,7 @@ go32_sysinfo (const char *arg, int from_tty)
|
|||||||
__dpmi_int (0x21, ®s);
|
__dpmi_int (0x21, ®s);
|
||||||
if ((regs.x.flags & 1) != 0)
|
if ((regs.x.flags & 1) != 0)
|
||||||
regs.h.al = 0;
|
regs.h.al = 0;
|
||||||
printfi_filtered (31, "UMBs %sin DOS memory chain\n",
|
printf_filtered ("%*sUMBs %sin DOS memory chain\n", 31, "",
|
||||||
regs.h.al == 0 ? "not " : "");
|
regs.h.al == 0 ? "not " : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1595,7 +1595,7 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
printf_filtered ("TSS selector=0x%04x", descr.base0);
|
printf_filtered ("TSS selector=0x%04x", descr.base0);
|
||||||
printfi_filtered (16, "Task Gate");
|
printf_filtered ("%*sTask Gate", 16, "");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
|
@ -582,7 +582,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
|
|||||||
fprintf_filtered (stream, ";\n");
|
fprintf_filtered (stream, ";\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintfi_filtered (level, stream, "END ");
|
fprintf_filtered (stream, "%*sEND ", level, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,9 +564,11 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0))
|
if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0))
|
||||||
{
|
{
|
||||||
if (type->is_stub ())
|
if (type->is_stub ())
|
||||||
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
|
fprintf_filtered (stream, "%*s<incomplete type>\n",
|
||||||
|
level + 4, "");
|
||||||
else
|
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
|
/* Start off with no specific section type, so we can print
|
||||||
@ -597,8 +599,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_protected)
|
if (section_type != s_protected)
|
||||||
{
|
{
|
||||||
section_type = s_protected;
|
section_type = s_protected;
|
||||||
fprintfi_filtered (level + 2, stream,
|
fprintf_filtered (stream, "%*sprotected\n",
|
||||||
"protected\n");
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TYPE_FIELD_PRIVATE (type, i))
|
else if (TYPE_FIELD_PRIVATE (type, i))
|
||||||
@ -606,7 +608,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_private)
|
if (section_type != s_private)
|
||||||
{
|
{
|
||||||
section_type = s_private;
|
section_type = s_private;
|
||||||
fprintfi_filtered (level + 2, stream, "private\n");
|
fprintf_filtered (stream, "%*sprivate\n",
|
||||||
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -614,7 +617,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_public)
|
if (section_type != s_public)
|
||||||
{
|
{
|
||||||
section_type = s_public;
|
section_type = s_public;
|
||||||
fprintfi_filtered (level + 2, stream, "public\n");
|
fprintf_filtered (stream, "%*spublic\n",
|
||||||
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -668,8 +672,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_protected)
|
if (section_type != s_protected)
|
||||||
{
|
{
|
||||||
section_type = s_protected;
|
section_type = s_protected;
|
||||||
fprintfi_filtered (level + 2, stream,
|
fprintf_filtered (stream, "%*sprotected\n",
|
||||||
"protected\n");
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TYPE_FN_FIELD_PRIVATE (f, j))
|
else if (TYPE_FN_FIELD_PRIVATE (f, j))
|
||||||
@ -677,7 +681,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_private)
|
if (section_type != s_private)
|
||||||
{
|
{
|
||||||
section_type = s_private;
|
section_type = s_private;
|
||||||
fprintfi_filtered (level + 2, stream, "private\n");
|
fprintf_filtered (stream, "%*sprivate\n",
|
||||||
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -685,7 +690,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
if (section_type != s_public)
|
if (section_type != s_public)
|
||||||
{
|
{
|
||||||
section_type = s_public;
|
section_type = s_public;
|
||||||
fprintfi_filtered (level + 2, stream, "public\n");
|
fprintf_filtered (stream, "%*spublic\n",
|
||||||
|
level + 2, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,7 +742,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
|||||||
fprintf_filtered (stream, ";\n");
|
fprintf_filtered (stream, ";\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintfi_filtered (level, stream, "end");
|
fprintf_filtered (stream, "%*send", level, "");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -849,7 +849,8 @@ rust_internal_print_type (struct type *type, const char *varstring,
|
|||||||
&& name[len] == ':'
|
&& name[len] == ':'
|
||||||
&& name[len + 1] == ':')
|
&& name[len + 1] == ':')
|
||||||
name += len + 2;
|
name += len + 2;
|
||||||
fprintfi_filtered (level + 2, stream, "%ps,\n",
|
fprintf_filtered (stream, "%*s%ps,\n",
|
||||||
|
level + 2, "",
|
||||||
styled_string (variable_name_style.style (),
|
styled_string (variable_name_style.style (),
|
||||||
name));
|
name));
|
||||||
}
|
}
|
||||||
|
30
gdb/utils.c
30
gdb/utils.c
@ -2183,22 +2183,6 @@ fprintf_unfiltered (struct ui_file *stream, const char *format, ...)
|
|||||||
va_end (args);
|
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. */
|
/* See utils.h. */
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2263,20 +2247,6 @@ printf_unfiltered (const char *format, ...)
|
|||||||
va_end (args);
|
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!
|
/* Easy -- but watch out!
|
||||||
|
|
||||||
This routine is *not* a replacement for puts()! puts() appends a newline.
|
This routine is *not* a replacement for puts()! puts() appends a newline.
|
||||||
|
@ -443,13 +443,8 @@ extern void vfprintf_filtered (struct ui_file *, const char *, va_list)
|
|||||||
extern void fprintf_filtered (struct ui_file *, const char *, ...)
|
extern void fprintf_filtered (struct ui_file *, const char *, ...)
|
||||||
ATTRIBUTE_PRINTF (2, 3);
|
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 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 vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
|
||||||
|
|
||||||
extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)
|
extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)
|
||||||
|
Reference in New Issue
Block a user