1 /* Support for printing Ada values for GDB, the GNU debugger.
2 Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1997, 2001
3 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
25 #include "expression.h"
34 /* Encapsulates arguments to ada_val_print. */
35 struct ada_val_print_args
41 struct ui_file *stream;
45 enum val_prettyprint pretty;
48 extern int inspect_it;
49 extern unsigned int repeat_count_threshold;
51 static void print_record (struct type *, char *, struct ui_file *, int,
52 int, enum val_prettyprint);
54 static int print_field_values (struct type *, char *, struct ui_file *,
55 int, int, enum val_prettyprint,
56 int, struct type *, char *);
58 static int print_variant_part (struct type *, int, char *,
59 struct ui_file *, int, int,
60 enum val_prettyprint, int, struct type *,
63 static void val_print_packed_array_elements (struct type *, char *valaddr,
64 int, struct ui_file *, int, int,
65 enum val_prettyprint);
67 static void adjust_type_signedness (struct type *);
69 static int ada_val_print_stub (PTR args0);
71 static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
72 struct ui_file *, int, int, int,
73 enum val_prettyprint);
76 /* Make TYPE unsigned if its range of values includes no negatives. */
78 adjust_type_signedness (struct type *type)
80 if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
81 && TYPE_LOW_BOUND (type) >= 0)
82 TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
85 /* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
86 if non-standard (i.e., other than 1 for numbers, other than lower bound
87 of index type for enumerated type). Returns 1 if something printed,
91 print_optional_low_bound (struct ui_file *stream, struct type *type)
93 struct type *index_type;
96 index_type = TYPE_INDEX_TYPE (type);
99 if (index_type == NULL)
101 if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
103 low_bound = TYPE_LOW_BOUND (index_type);
104 index_type = TYPE_TARGET_TYPE (index_type);
109 switch (TYPE_CODE (index_type))
112 if (low_bound == TYPE_FIELD_BITPOS (index_type, 0))
115 case TYPE_CODE_UNDEF:
116 index_type = builtin_type_long;
124 ada_print_scalar (index_type, (LONGEST) low_bound, stream);
125 fprintf_filtered (stream, " => ");
129 /* Version of val_print_array_elements for GNAT-style packed arrays.
130 Prints elements of packed array of type TYPE at bit offset
131 BITOFFSET from VALADDR on STREAM. Formats according to FORMAT and
132 separates with commas. RECURSE is the recursion (nesting) level.
133 If PRETTY, uses "prettier" format. TYPE must have been decoded (as
134 by ada_coerce_to_simple_array). */
137 val_print_packed_array_elements (struct type *type, char *valaddr,
138 int bitoffset, struct ui_file *stream,
139 int format, int recurse,
140 enum val_prettyprint pretty)
143 unsigned int things_printed = 0;
145 struct type *elttype;
147 /* Position of the array element we are examining to see
148 whether it is repeated. */
150 /* Number of repetitions we have detected so far. */
152 unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0);
153 struct value *mark = value_mark ();
155 elttype = TYPE_TARGET_TYPE (type);
156 eltlen = TYPE_LENGTH (check_typedef (elttype));
160 if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0), &low, &high) < 0)
163 len = high - low + 1;
167 annotate_array_section_begin (i, elttype);
169 while (i < len && things_printed < print_max)
171 struct value *v0, *v1;
176 if (prettyprint_arrays)
178 fprintf_filtered (stream, ",\n");
179 print_spaces_filtered (2 + 2 * recurse, stream);
183 fprintf_filtered (stream, ", ");
186 wrap_here (n_spaces (2 + 2 * recurse));
189 v0 = ada_value_primitive_packed_val (NULL, valaddr,
190 (i0 * bitsize) / HOST_CHAR_BIT,
191 (i0 * bitsize) % HOST_CHAR_BIT,
198 v1 = ada_value_primitive_packed_val (NULL, valaddr,
199 (i * bitsize) / HOST_CHAR_BIT,
200 (i * bitsize) % HOST_CHAR_BIT,
202 if (memcmp (VALUE_CONTENTS (v0), VALUE_CONTENTS (v1), eltlen) != 0)
206 if (i - i0 > repeat_count_threshold)
208 val_print (elttype, VALUE_CONTENTS (v0), 0, 0, stream, format,
209 0, recurse + 1, pretty);
210 annotate_elt_rep (i - i0);
211 fprintf_filtered (stream, " <repeats %u times>", i - i0);
212 annotate_elt_rep_end ();
218 for (j = i0; j < i; j += 1)
222 if (prettyprint_arrays)
224 fprintf_filtered (stream, ",\n");
225 print_spaces_filtered (2 + 2 * recurse, stream);
229 fprintf_filtered (stream, ", ");
231 wrap_here (n_spaces (2 + 2 * recurse));
233 val_print (elttype, VALUE_CONTENTS (v0), 0, 0, stream, format,
234 0, recurse + 1, pretty);
238 things_printed += i - i0;
240 annotate_array_section_end ();
243 fprintf_filtered (stream, "...");
246 value_free_to_mark (mark);
250 printable_val_type (struct type *type, char *valaddr)
252 return ada_to_fixed_type (ada_aligned_type (type), valaddr, 0, NULL);
255 /* Print the character C on STREAM as part of the contents of a literal
256 string whose delimiter is QUOTER. TYPE_LEN is the length in bytes
257 (1 or 2) of the character. */
260 ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len)
265 c &= (1 << (type_len * TARGET_CHAR_BIT)) - 1;
267 if (isascii (c) && isprint (c))
269 if (c == quoter && c == '"')
270 fprintf_filtered (stream, "[\"%c\"]", quoter);
272 fprintf_filtered (stream, "%c", c);
275 fprintf_filtered (stream, "[\"%0*x\"]", type_len * 2, c);
278 /* Character #I of STRING, given that TYPE_LEN is the size in bytes (1
279 or 2) of a character. */
282 char_at (char *string, int i, int type_len)
287 return (int) extract_unsigned_integer (string + 2 * i, 2);
291 ada_printchar (int c, struct ui_file *stream)
293 fputs_filtered ("'", stream);
294 ada_emit_char (c, stream, '\'', 1);
295 fputs_filtered ("'", stream);
298 /* [From print_type_scalar in typeprint.c]. Print VAL on STREAM in a
299 form appropriate for TYPE. */
302 ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
307 CHECK_TYPEDEF (type);
309 switch (TYPE_CODE (type))
313 len = TYPE_NFIELDS (type);
314 for (i = 0; i < len; i++)
316 if (TYPE_FIELD_BITPOS (type, i) == val)
323 fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream);
327 print_longest (stream, 'd', 0, val);
332 print_longest (stream, TYPE_UNSIGNED (type) ? 'u' : 'd', 0, val);
336 LA_PRINT_CHAR ((unsigned char) val, stream);
340 fprintf_filtered (stream, val ? "true" : "false");
343 case TYPE_CODE_RANGE:
344 ada_print_scalar (TYPE_TARGET_TYPE (type), val, stream);
347 case TYPE_CODE_UNDEF:
349 case TYPE_CODE_ARRAY:
350 case TYPE_CODE_STRUCT:
351 case TYPE_CODE_UNION:
356 case TYPE_CODE_STRING:
357 case TYPE_CODE_ERROR:
358 case TYPE_CODE_MEMBER:
359 case TYPE_CODE_METHOD:
361 warning ("internal error: unhandled type in ada_print_scalar");
365 error ("Invalid type code in symbol table.");
370 /* Print the character string STRING, printing at most LENGTH characters.
371 Printing stops early if the number hits print_max; repeat counts
372 are printed as appropriate. Print ellipses at the end if we
373 had to stop before printing LENGTH characters, or if
374 FORCE_ELLIPSES. TYPE_LEN is the length (1 or 2) of the character type.
378 printstr (struct ui_file *stream, char *string, unsigned int length,
379 int force_ellipses, int type_len)
382 unsigned int things_printed = 0;
388 fputs_filtered ("\"\"", stream);
392 for (i = 0; i < length && things_printed < print_max; i += 1)
394 /* Position of the character we are examining
395 to see whether it is repeated. */
397 /* Number of repetitions we have detected so far. */
404 fputs_filtered (", ", stream);
410 while (rep1 < length &&
411 char_at (string, rep1, type_len) == char_at (string, i,
418 if (reps > repeat_count_threshold)
423 fputs_filtered ("\\\", ", stream);
425 fputs_filtered ("\", ", stream);
428 fputs_filtered ("'", stream);
429 ada_emit_char (char_at (string, i, type_len), stream, '\'',
431 fputs_filtered ("'", stream);
432 fprintf_filtered (stream, " <repeats %u times>", reps);
434 things_printed += repeat_count_threshold;
442 fputs_filtered ("\\\"", stream);
444 fputs_filtered ("\"", stream);
447 ada_emit_char (char_at (string, i, type_len), stream, '"',
453 /* Terminate the quotes if necessary. */
457 fputs_filtered ("\\\"", stream);
459 fputs_filtered ("\"", stream);
462 if (force_ellipses || i < length)
463 fputs_filtered ("...", stream);
467 ada_printstr (struct ui_file *stream, char *string, unsigned int length,
468 int force_ellipses, int width)
470 printstr (stream, string, length, force_ellipses, width);
474 /* Print data of type TYPE located at VALADDR (within GDB), which came from
475 the inferior at address ADDRESS, onto stdio stream STREAM according to
476 FORMAT (a letter as for the printf % codes or 0 for natural format).
477 The data at VALADDR is in target byte order.
479 If the data is printed as a string, returns the number of string characters
482 If DEREF_REF is nonzero, then dereference references, otherwise just print
485 RECURSE indicates the amount of indentation to supply before
486 continuation lines; this amount is roughly twice the value of RECURSE.
488 When PRETTY is non-zero, prints record fields on separate lines.
489 (For some reason, the current version of gdb instead uses a global
490 variable---prettyprint_arrays--- to causes a similar effect on
494 ada_val_print (struct type *type, char *valaddr0, int embedded_offset,
495 CORE_ADDR address, struct ui_file *stream, int format,
496 int deref_ref, int recurse, enum val_prettyprint pretty)
498 struct ada_val_print_args args;
500 args.valaddr0 = valaddr0;
501 args.embedded_offset = embedded_offset;
502 args.address = address;
503 args.stream = stream;
504 args.format = format;
505 args.deref_ref = deref_ref;
506 args.recurse = recurse;
507 args.pretty = pretty;
509 return catch_errors (ada_val_print_stub, &args, NULL, RETURN_MASK_ALL);
512 /* Helper for ada_val_print; used as argument to catch_errors to
513 unmarshal the arguments to ada_val_print_1, which does the work. */
515 ada_val_print_stub (PTR args0)
517 struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
518 return ada_val_print_1 (argsp->type, argsp->valaddr0,
519 argsp->embedded_offset, argsp->address,
520 argsp->stream, argsp->format, argsp->deref_ref,
521 argsp->recurse, argsp->pretty);
524 /* See the comment on ada_val_print. This function differs in that it
525 * does not catch evaluation errors (leaving that to ada_val_print). */
528 ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
529 CORE_ADDR address, struct ui_file *stream, int format,
530 int deref_ref, int recurse, enum val_prettyprint pretty)
534 struct type *elttype;
538 char *valaddr = valaddr0 + embedded_offset;
540 CHECK_TYPEDEF (type);
542 if (ada_is_array_descriptor (type) || ada_is_packed_array_type (type))
545 struct value *mark = value_mark ();
547 val = value_from_contents_and_address (type, valaddr, address);
548 val = ada_coerce_to_simple_array_ptr (val);
551 fprintf_filtered (stream, "(null)");
555 retn = ada_val_print_1 (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
556 VALUE_ADDRESS (val), stream, format,
557 deref_ref, recurse, pretty);
558 value_free_to_mark (mark);
562 valaddr = ada_aligned_value_addr (type, valaddr);
563 embedded_offset -= valaddr - valaddr0 - embedded_offset;
564 type = printable_val_type (type, valaddr);
566 switch (TYPE_CODE (type))
569 return c_val_print (type, valaddr0, embedded_offset, address, stream,
570 format, deref_ref, recurse, pretty);
573 case TYPE_CODE_RANGE:
574 if (ada_is_fixed_point_type (type))
576 LONGEST v = unpack_long (type, valaddr);
577 int len = TYPE_LENGTH (type);
579 fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g",
580 (double) ada_fixed_to_float (type, v));
583 else if (ada_is_vax_floating_type (type))
586 value_from_contents_and_address (type, valaddr, address);
587 struct value *func = ada_vax_float_print_function (type);
590 static struct type *parray_of_char = NULL;
591 struct value *printable_val;
593 if (parray_of_char == NULL)
597 (NULL, builtin_type_char,
598 create_range_type (NULL, builtin_type_int, 0, 32)), NULL);
601 value_ind (value_cast (parray_of_char,
602 call_function_by_hand (func, 1,
605 fprintf_filtered (stream, "%s", VALUE_CONTENTS (printable_val));
608 /* No special printing function. Do as best we can. */
610 else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
612 struct type *target_type = TYPE_TARGET_TYPE (type);
613 if (TYPE_LENGTH (type) != TYPE_LENGTH (target_type))
615 /* Obscure case of range type that has different length from
616 its base type. Perform a conversion, or we will get a
617 nonsense value. Actually, we could use the same
618 code regardless of lengths; I'm just avoiding a cast. */
619 struct value *v = value_cast (target_type,
620 value_from_contents_and_address
622 return ada_val_print_1 (target_type, VALUE_CONTENTS (v), 0, 0,
623 stream, format, 0, recurse + 1, pretty);
626 return ada_val_print_1 (TYPE_TARGET_TYPE (type),
627 valaddr0, embedded_offset,
628 address, stream, format, deref_ref,
633 format = format ? format : output_format;
636 print_scalar_formatted (valaddr, type, format, 0, stream);
640 val_print_type_code_int (type, valaddr, stream);
641 if (ada_is_character_type (type))
643 fputs_filtered (" ", stream);
644 ada_printchar ((unsigned char) unpack_long (type, valaddr),
654 print_scalar_formatted (valaddr, type, format, 0, stream);
657 len = TYPE_NFIELDS (type);
658 val = unpack_long (type, valaddr);
659 for (i = 0; i < len; i++)
662 if (val == TYPE_FIELD_BITPOS (type, i))
669 const char *name = ada_enum_name (TYPE_FIELD_NAME (type, i));
671 fprintf_filtered (stream, "%ld %s", (long) val, name);
673 fputs_filtered (name, stream);
677 print_longest (stream, 'd', 0, val);
681 case TYPE_CODE_UNION:
682 case TYPE_CODE_STRUCT:
683 if (ada_is_bogus_array_descriptor (type))
685 fprintf_filtered (stream, "(...?)");
690 print_record (type, valaddr, stream, format, recurse, pretty);
694 case TYPE_CODE_ARRAY:
695 if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
697 elttype = TYPE_TARGET_TYPE (type);
698 eltlen = TYPE_LENGTH (elttype);
699 len = TYPE_LENGTH (type) / eltlen;
701 /* For an array of chars, print with string syntax. */
702 if (ada_is_string_type (type) && (format == 0 || format == 's'))
704 if (prettyprint_arrays)
706 print_spaces_filtered (2 + 2 * recurse, stream);
708 /* If requested, look for the first null char and only print
709 elements up to it. */
710 if (stop_print_at_null)
714 /* Look for a NULL char. */
716 temp_len < len && temp_len < print_max
717 && char_at (valaddr, temp_len, eltlen) != 0;
722 printstr (stream, valaddr, len, 0, eltlen);
727 fprintf_filtered (stream, "(");
728 print_optional_low_bound (stream, type);
729 if (TYPE_FIELD_BITSIZE (type, 0) > 0)
730 val_print_packed_array_elements (type, valaddr, 0, stream,
731 format, recurse, pretty);
733 val_print_array_elements (type, valaddr, address, stream,
734 format, deref_ref, recurse,
736 fprintf_filtered (stream, ")");
743 elttype = check_typedef (TYPE_TARGET_TYPE (type));
746 fprintf_filtered (stream, "@");
747 print_address_numeric
748 (extract_address (valaddr,
749 TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
751 fputs_filtered (": ", stream);
753 /* De-reference the reference */
756 if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
758 LONGEST deref_val_int = (LONGEST)
759 unpack_pointer (lookup_pointer_type (builtin_type_void),
761 if (deref_val_int != 0)
763 struct value *deref_val =
764 ada_value_ind (value_from_longest
765 (lookup_pointer_type (elttype),
767 val_print (VALUE_TYPE (deref_val),
768 VALUE_CONTENTS (deref_val), 0,
769 VALUE_ADDRESS (deref_val), stream, format,
770 deref_ref, recurse + 1, pretty);
773 fputs_filtered ("(null)", stream);
776 fputs_filtered ("???", stream);
784 print_variant_part (struct type *type, int field_num, char *valaddr,
785 struct ui_file *stream, int format, int recurse,
786 enum val_prettyprint pretty, int comma_needed,
787 struct type *outer_type, char *outer_valaddr)
789 struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
790 int which = ada_which_variant_applies (var_type, outer_type, outer_valaddr);
795 return print_field_values
796 (TYPE_FIELD_TYPE (var_type, which),
797 valaddr + TYPE_FIELD_BITPOS (type, field_num) / HOST_CHAR_BIT
798 + TYPE_FIELD_BITPOS (var_type, which) / HOST_CHAR_BIT,
799 stream, format, recurse, pretty,
800 comma_needed, outer_type, outer_valaddr);
804 ada_value_print (struct value *val0, struct ui_file *stream, int format,
805 enum val_prettyprint pretty)
807 char *valaddr = VALUE_CONTENTS (val0);
808 CORE_ADDR address = VALUE_ADDRESS (val0) + VALUE_OFFSET (val0);
810 ada_to_fixed_type (VALUE_TYPE (val0), valaddr, address, NULL);
812 value_from_contents_and_address (type, valaddr, address);
814 /* If it is a pointer, indicate what it points to. */
815 if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF)
817 /* Hack: remove (char *) for char strings. Their
818 type is indicated by the quoted string anyway. */
819 if (TYPE_CODE (type) == TYPE_CODE_PTR &&
820 TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof (char) &&
821 TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT &&
822 !TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
828 fprintf_filtered (stream, "(");
829 type_print (type, "", stream, -1);
830 fprintf_filtered (stream, ") ");
833 else if (ada_is_array_descriptor (type))
835 fprintf_filtered (stream, "(");
836 type_print (type, "", stream, -1);
837 fprintf_filtered (stream, ") ");
839 else if (ada_is_bogus_array_descriptor (type))
841 fprintf_filtered (stream, "(");
842 type_print (type, "", stream, -1);
843 fprintf_filtered (stream, ") (...?)");
846 return (val_print (type, VALUE_CONTENTS (val), 0, address,
847 stream, format, 1, 0, pretty));
851 print_record (struct type *type, char *valaddr, struct ui_file *stream,
852 int format, int recurse, enum val_prettyprint pretty)
854 CHECK_TYPEDEF (type);
856 fprintf_filtered (stream, "(");
858 if (print_field_values (type, valaddr, stream, format, recurse, pretty,
859 0, type, valaddr) != 0 && pretty)
861 fprintf_filtered (stream, "\n");
862 print_spaces_filtered (2 * recurse, stream);
865 fprintf_filtered (stream, ")");
868 /* Print out fields of value at VALADDR having structure type TYPE.
870 TYPE, VALADDR, STREAM, FORMAT, RECURSE, and PRETTY have the
871 same meanings as in ada_print_value and ada_val_print.
873 OUTER_TYPE and OUTER_VALADDR give type and address of enclosing record
874 (used to get discriminant values when printing variant parts).
876 COMMA_NEEDED is 1 if fields have been printed at the current recursion
877 level, so that a comma is needed before any field printed by this
880 Returns 1 if COMMA_NEEDED or any fields were printed. */
883 print_field_values (struct type *type, char *valaddr, struct ui_file *stream,
884 int format, int recurse, enum val_prettyprint pretty,
885 int comma_needed, struct type *outer_type,
890 len = TYPE_NFIELDS (type);
892 for (i = 0; i < len; i += 1)
894 if (ada_is_ignored_field (type, i))
897 if (ada_is_wrapper_field (type, i))
900 print_field_values (TYPE_FIELD_TYPE (type, i),
902 + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
903 stream, format, recurse, pretty,
904 comma_needed, type, valaddr);
907 else if (ada_is_variant_part (type, i))
910 print_variant_part (type, i, valaddr,
911 stream, format, recurse, pretty, comma_needed,
912 outer_type, outer_valaddr);
917 fprintf_filtered (stream, ", ");
922 fprintf_filtered (stream, "\n");
923 print_spaces_filtered (2 + 2 * recurse, stream);
927 wrap_here (n_spaces (2 + 2 * recurse));
931 if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
932 fputs_filtered ("\"( ptr \"", stream);
934 fputs_filtered ("\"( nodef \"", stream);
935 fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
936 language_cplus, DMGL_NO_OPTS);
937 fputs_filtered ("\" \"", stream);
938 fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
939 language_cplus, DMGL_NO_OPTS);
940 fputs_filtered ("\") \"", stream);
944 annotate_field_begin (TYPE_FIELD_TYPE (type, i));
945 fprintf_filtered (stream, "%.*s",
946 ada_name_prefix_len (TYPE_FIELD_NAME (type, i)),
947 TYPE_FIELD_NAME (type, i));
948 annotate_field_name_end ();
949 fputs_filtered (" => ", stream);
950 annotate_field_value ();
953 if (TYPE_FIELD_PACKED (type, i))
957 /* Bitfields require special handling, especially due to byte
959 if (TYPE_CPLUS_SPECIFIC (type) != NULL
960 && TYPE_FIELD_IGNORE (type, i))
962 fputs_filtered ("<optimized out or zero length>", stream);
966 int bit_pos = TYPE_FIELD_BITPOS (type, i);
967 int bit_size = TYPE_FIELD_BITSIZE (type, i);
969 adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
970 v = ada_value_primitive_packed_val (NULL, valaddr,
971 bit_pos / HOST_CHAR_BIT,
972 bit_pos % HOST_CHAR_BIT,
974 TYPE_FIELD_TYPE (type, i));
975 val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
976 stream, format, 0, recurse + 1, pretty);
980 ada_val_print (TYPE_FIELD_TYPE (type, i),
981 valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
982 0, 0, stream, format, 0, recurse + 1, pretty);
983 annotate_field_end ();