- val_print (value_type (deref_val),
- value_embedded_offset (deref_val),
- value_address (deref_val), stream, recurse + 1,
- deref_val, options, language_def (language_ada));
-}
-
-/* See the comment on ada_val_print. This function differs in that it
- does not catch evaluation errors (leaving that to ada_val_print). */
-
-static void
-ada_val_print_1 (struct type *type,
- int offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-{
- int offset_aligned;
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
-
- type = ada_check_typedef (type);
-
- if (ada_is_array_descriptor_type (type)
- || (ada_is_constrained_packed_array_type (type)
- && TYPE_CODE (type) != TYPE_CODE_PTR))
- {
- struct value *val = value_from_contents_and_address (type,
- valaddr + offset,
- address);
- ada_val_print_gnat_array (val, stream, recurse, options);
- return;
- }
-
- offset_aligned = offset + ada_aligned_value_addr (type, valaddr) - valaddr;
- type = printable_val_type (type, valaddr + offset_aligned);
- type = resolve_dynamic_type (type, valaddr + offset_aligned,
- address + offset_aligned);
-
- switch (TYPE_CODE (type))
- {
- default:
- val_print (type, offset, address, stream, recurse,
- original_value, options, language_def (language_c));
- break;
-
- case TYPE_CODE_PTR:
- ada_val_print_ptr (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- break;
-
- case TYPE_CODE_INT:
- case TYPE_CODE_RANGE:
- ada_val_print_num (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- break;
-
- case TYPE_CODE_ENUM:
- ada_val_print_enum (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- break;
-
- case TYPE_CODE_FLT:
- ada_val_print_flt (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- break;
-
- case TYPE_CODE_UNION:
- case TYPE_CODE_STRUCT:
- ada_val_print_struct_union (type, valaddr, offset, offset_aligned,
- address, stream, recurse,
- original_value, options);
- break;
-
- case TYPE_CODE_ARRAY:
- ada_val_print_array (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- return;
-
- case TYPE_CODE_REF:
- ada_val_print_ref (type, valaddr, offset, offset_aligned,
- address, stream, recurse, original_value,
- options);
- break;
- }
-}
-
-/* See val_print for a description of the various parameters of this
- function; they are identical. */
-
-void
-ada_val_print (struct type *type,
- int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-{
- try
- {
- ada_val_print_1 (type, embedded_offset, address,
- stream, recurse, val, options);
- }
- catch (const gdb_exception_error &except)
- {
- fprintf_styled (stream, metadata_style.style (),
- _("<error reading variable: %s>"),
- except.what ());
- }