aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-03-13 17:39:52 -0600
committerTom Tromey <tom@tromey.com>2020-03-13 18:03:42 -0600
commit426a9c18dddcdd5f640b702734dd8f9c108b7372 (patch)
treed9ba80f648c60ab6d3a95de00187889200459f8f /gdb/f-valprint.c
parent42331a1ea2a13ce15ec202c5f0fbef3e5171253c (diff)
downloadfsf-binutils-gdb-426a9c18dddcdd5f640b702734dd8f9c108b7372.zip
fsf-binutils-gdb-426a9c18dddcdd5f640b702734dd8f9c108b7372.tar.gz
fsf-binutils-gdb-426a9c18dddcdd5f640b702734dd8f9c108b7372.tar.bz2
Remove val_print
We can finally remove val_print and various helper functions that are no longer needed. gdb/ChangeLog 2020-03-13 Tom Tromey <tom@tromey.com> * value.h (val_print): Don't declare. * valprint.h (val_print_array_elements) (val_print_scalar_formatted, generic_val_print): Don't declare. * valprint.c (generic_val_print_array): Take a struct value. (generic_val_print_ptr, generic_val_print_memberptr) (generic_val_print_bool, generic_val_print_int) (generic_val_print_char, generic_val_print_complex) (generic_val_print): Remove. (generic_value_print): Update. (do_val_print): Remove unused parameters. Don't call la_val_print. (val_print): Remove. (common_val_print): Update. Don't call value_check_printable. (val_print_scalar_formatted, val_print_array_elements): Remove. * rust-lang.c (rust_val_print): Remove. (rust_language_defn): Update. * p-valprint.c (pascal_val_print): Remove. (pascal_value_print_inner): Update. (pascal_object_print_val_fields, pascal_object_print_val): Remove. (pascal_object_print_static_field): Update. * p-lang.h (pascal_val_print): Don't declare. * p-lang.c (pascal_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * m2-valprint.c (m2_print_unbounded_array, m2_val_print): Remove. * m2-lang.h (m2_val_print): Don't declare. * m2-lang.c (m2_language_defn): Update. * language.h (struct language_defn) <la_val_print>: Remove. * language.c (unk_lang_value_print_inner): Rename. Change argument types. (unknown_language_defn, auto_language_defn): Update. * go-valprint.c (go_val_print): Remove. * go-lang.h (go_val_print): Don't declare. * go-lang.c (go_language_defn): Update. * f-valprint.c (f_val_print): Remove. * f-lang.h (f_value_print): Don't declare. * f-lang.c (f_language_defn): Update. * d-valprint.c (d_val_print): Remove. * d-lang.h (d_value_print): Don't declare. * d-lang.c (d_language_defn): Update. * cp-valprint.c (cp_print_value_fields) (cp_print_value_fields_rtti, cp_print_value): Remove. (cp_print_static_field): Update. * c-valprint.c (c_val_print_array, c_val_print_ptr) (c_val_print_struct, c_val_print_union, c_val_print_int) (c_val_print_memberptr, c_val_print): Remove. * c-lang.h (c_val_print_array, cp_print_value_fields) (cp_print_value_fields_rtti): Don't declare. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * ada-valprint.c (ada_val_print_ptr, ada_val_print_num): Remove. (ada_val_print_enum): Take a struct value. (ada_val_print_flt, ada_val_print_array, ada_val_print_1) (ada_val_print): Remove. (ada_value_print_1): Update. (printable_val_type): Remove. * ada-lang.h (ada_val_print): Don't declare. * ada-lang.c (ada_language_defn): Update.
Diffstat (limited to 'gdb/f-valprint.c')
-rw-r--r--gdb/f-valprint.c186
1 files changed, 0 insertions, 186 deletions
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index f927214..36328c7 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -208,192 +208,6 @@ static const struct generic_val_print_decorations f_decorations =
"}"
};
-/* See val_print for a description of the various parameters of this
- function; they are identical. */
-
-void
-f_val_print (struct type *type, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-{
- struct gdbarch *gdbarch = get_type_arch (type);
- int printed_field = 0; /* Number of fields printed. */
- struct type *elttype;
- CORE_ADDR addr;
- int index;
- const gdb_byte *valaddr =value_contents_for_printing (original_value);
-
- type = check_typedef (type);
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_STRING:
- f77_get_dynamic_length_of_aggregate (type);
- LA_PRINT_STRING (stream, builtin_type (gdbarch)->builtin_char,
- valaddr + embedded_offset,
- TYPE_LENGTH (type), NULL, 0, options);
- break;
-
- case TYPE_CODE_ARRAY:
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_CHAR)
- {
- fprintf_filtered (stream, "(");
- f77_print_array (type, valaddr, embedded_offset,
- address, stream, recurse, original_value, options);
- fprintf_filtered (stream, ")");
- }
- else
- {
- struct type *ch_type = TYPE_TARGET_TYPE (type);
-
- f77_get_dynamic_length_of_aggregate (type);
- LA_PRINT_STRING (stream, ch_type,
- valaddr + embedded_offset,
- TYPE_LENGTH (type) / TYPE_LENGTH (ch_type),
- NULL, 0, options);
- }
- break;
-
- case TYPE_CODE_PTR:
- if (options->format && options->format != 's')
- {
- val_print_scalar_formatted (type, embedded_offset,
- original_value, options, 0, stream);
- break;
- }
- else
- {
- int want_space = 0;
-
- addr = unpack_pointer (type, valaddr + embedded_offset);
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
-
- if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
- {
- /* Try to print what function it points to. */
- print_function_pointer_address (options, gdbarch, addr, stream);
- return;
- }
-
- if (options->symbol_print)
- want_space = print_address_demangle (options, gdbarch, addr,
- stream, demangle);
- else if (options->addressprint && options->format != 's')
- {
- fputs_filtered (paddress (gdbarch, addr), stream);
- want_space = 1;
- }
-
- /* For a pointer to char or unsigned char, also print the string
- pointed to, unless pointer is null. */
- if (TYPE_LENGTH (elttype) == 1
- && TYPE_CODE (elttype) == TYPE_CODE_INT
- && (options->format == 0 || options->format == 's')
- && addr != 0)
- {
- if (want_space)
- fputs_filtered (" ", stream);
- val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
- stream, options);
- }
- return;
- }
- break;
-
- case TYPE_CODE_INT:
- if (options->format || options->output_format)
- {
- struct value_print_options opts = *options;
-
- opts.format = (options->format ? options->format
- : options->output_format);
- val_print_scalar_formatted (type, embedded_offset,
- original_value, &opts, 0, stream);
- }
- else
- val_print_scalar_formatted (type, embedded_offset,
- original_value, options, 0, stream);
- break;
-
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- /* Starting from the Fortran 90 standard, Fortran supports derived
- types. */
- fprintf_filtered (stream, "( ");
- for (index = 0; index < TYPE_NFIELDS (type); index++)
- {
- struct value *field = value_field
- ((struct value *)original_value, index);
-
- struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, index));
-
-
- if (TYPE_CODE (field_type) != TYPE_CODE_FUNC)
- {
- const char *field_name;
-
- if (printed_field > 0)
- fputs_filtered (", ", stream);
-
- field_name = TYPE_FIELD_NAME (type, index);
- if (field_name != NULL)
- {
- fputs_styled (field_name, variable_name_style.style (),
- stream);
- fputs_filtered (" = ", stream);
- }
-
- common_val_print (field, stream, recurse + 1,
- options, current_language);
-
- ++printed_field;
- }
- }
- fprintf_filtered (stream, " )");
- break;
-
- case TYPE_CODE_BOOL:
- if (options->format || options->output_format)
- {
- struct value_print_options opts = *options;
- opts.format = (options->format ? options->format
- : options->output_format);
- val_print_scalar_formatted (type, embedded_offset,
- original_value, &opts, 0, stream);
- }
- else
- {
- int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
- LONGEST val
- = unpack_long (type, valaddr + embedded_offset * unit_size);
- /* The Fortran standard doesn't specify how logical types are
- represented. Different compilers use different non zero
- values to represent logical true. */
- if (val == 0)
- fputs_filtered (f_decorations.false_name, stream);
- else
- fputs_filtered (f_decorations.true_name, stream);
- }
- break;
-
- case TYPE_CODE_REF:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_FLAGS:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_CHAR:
- default:
- generic_val_print (type, embedded_offset, address,
- stream, recurse, original_value, options,
- &f_decorations);
- break;
- }
-}
-
/* See f-lang.h. */
void