gdb: remove TYPE_INDEX_TYPE macro
[deliverable/binutils-gdb.git] / gdb / valprint.c
index d678ad3091a46848f47b86a4e0f0b51480a76955..7051fcef13f68e131d3faa922ec9a4b4605eeb22 100644 (file)
@@ -781,19 +781,15 @@ generic_value_print_char (struct value *value, struct ui_file *stream,
 /* generic_val_print helper for TYPE_CODE_FLT and TYPE_CODE_DECFLOAT.  */
 
 static void
-generic_val_print_float (struct type *type,
-                        int embedded_offset, struct ui_file *stream,
+generic_val_print_float (struct type *type, struct ui_file *stream,
                         struct value *original_value,
                         const struct value_print_options *options)
 {
-  struct gdbarch *gdbarch = get_type_arch (type);
-  int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
-
   gdb_assert (!options->format);
 
   const gdb_byte *valaddr = value_contents_for_printing (original_value);
 
-  print_floating (valaddr + embedded_offset * unit_size, type, stream);
+  print_floating (valaddr, type, stream);
 }
 
 /* generic_value_print helper for TYPE_CODE_COMPLEX.  */
@@ -896,8 +892,7 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse,
       if (options->format)
        value_print_scalar_formatted (val, options, 0, stream);
       else
-       generic_val_print_float (type, 0, stream,
-                                val, options);
+       generic_val_print_float (type, stream, val, options);
       break;
 
     case TYPE_CODE_VOID:
@@ -1880,7 +1875,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream,
 
   elttype = TYPE_TARGET_TYPE (type);
   eltlen = type_length_units (check_typedef (elttype));
-  index_type = TYPE_INDEX_TYPE (type);
+  index_type = type->index_type ();
   if (index_type->code () == TYPE_CODE_RANGE)
     index_type = TYPE_TARGET_TYPE (index_type);
 
This page took 0.025367 seconds and 4 git commands to generate.