* ada-lang.c (ada_coerce_to_simple_array_type): Reimplement to
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 18 May 2009 13:47:44 +0000 (13:47 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Mon, 18 May 2009 13:47:44 +0000 (13:47 +0000)
avoid creating a dummy value.

gdb/ChangeLog
gdb/ada-lang.c

index 5e9931b7221c9fc0a287bcd70100c0b3cb5686bb..578ce18aa81518d08df8eb652358935a729a67b1 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-18  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * ada-lang.c (ada_coerce_to_simple_array_type): Reimplement to
+       avoid creating a dummy value.
+
 2009-05-18  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * p-valprint.c (pascal_val_print): Use extract_typed_address
index f8d68c1e6c19f3c8550cf016fe662899e88e789b..0725dbdd29ab2c4ab9c1c4060faf9c0ef95838c4 100644 (file)
@@ -1689,13 +1689,13 @@ ada_coerce_to_simple_array (struct value *arr)
 struct type *
 ada_coerce_to_simple_array_type (struct type *type)
 {
-  struct value *mark = value_mark ();
-  struct value *dummy = value_from_longest (builtin_type_int32, 0);
-  struct type *result;
-  deprecated_set_value_type (dummy, type);
-  result = ada_type_of_array (dummy, 0);
-  value_free_to_mark (mark);
-  return result;
+  if (ada_is_packed_array_type (type))
+    return decode_packed_array_type (type);
+
+  if (ada_is_array_descriptor_type (type))
+    return ada_check_typedef (TYPE_TARGET_TYPE (desc_data_type (type)));
+
+  return type;
 }
 
 /* Non-zero iff TYPE represents a standard GNAT packed-array type.  */
This page took 0.044331 seconds and 4 git commands to generate.