aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c80
1 files changed, 11 insertions, 69 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index b7d50e5..db778af 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -376,49 +376,6 @@ value_cast (struct type *type, struct value *arg2)
VALUE_POINTED_TO_OFFSET (arg2) = 0; /* pai: chk_val */
return arg2;
}
- /* OBSOLETE else if (chill_varying_type (type)) */
- /* OBSOLETE { */
- /* OBSOLETE struct type *range1, *range2, *eltype1, *eltype2; */
- /* OBSOLETE struct value *val; */
- /* OBSOLETE int count1, count2; */
- /* OBSOLETE LONGEST low_bound, high_bound; */
- /* OBSOLETE char *valaddr, *valaddr_data; */
- /* OBSOLETE *//* For lint warning about eltype2 possibly uninitialized: */
- /* OBSOLETE eltype2 = NULL; */
- /* OBSOLETE if (code2 == TYPE_CODE_BITSTRING) */
- /* OBSOLETE error ("not implemented: converting bitstring to varying type"); */
- /* OBSOLETE if ((code2 != TYPE_CODE_ARRAY && code2 != TYPE_CODE_STRING) */
- /* OBSOLETE || (eltype1 = check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 1))), */
- /* OBSOLETE eltype2 = check_typedef (TYPE_TARGET_TYPE (type2)), */
- /* OBSOLETE (TYPE_LENGTH (eltype1) != TYPE_LENGTH (eltype2) */
- /* OBSOLETE *//*|| TYPE_CODE (eltype1) != TYPE_CODE (eltype2) *//* ))) */
- /* OBSOLETE error ("Invalid conversion to varying type"); */
- /* OBSOLETE range1 = TYPE_FIELD_TYPE (TYPE_FIELD_TYPE (type, 1), 0); */
- /* OBSOLETE range2 = TYPE_FIELD_TYPE (type2, 0); */
- /* OBSOLETE if (get_discrete_bounds (range1, &low_bound, &high_bound) < 0) */
- /* OBSOLETE count1 = -1; */
- /* OBSOLETE else */
- /* OBSOLETE count1 = high_bound - low_bound + 1; */
- /* OBSOLETE if (get_discrete_bounds (range2, &low_bound, &high_bound) < 0) */
- /* OBSOLETE count1 = -1, count2 = 0; *//* To force error before */
- /* OBSOLETE else */
- /* OBSOLETE count2 = high_bound - low_bound + 1; */
- /* OBSOLETE if (count2 > count1) */
- /* OBSOLETE error ("target varying type is too small"); */
- /* OBSOLETE val = allocate_value (type); */
- /* OBSOLETE valaddr = VALUE_CONTENTS_RAW (val); */
- /* OBSOLETE valaddr_data = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8; */
- /* OBSOLETE *//* Set val's __var_length field to count2. */
- /* OBSOLETE store_signed_integer (valaddr, TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)), */
- /* OBSOLETE count2); */
- /* OBSOLETE *//* Set the __var_data field to count2 elements copied from arg2. */
- /* OBSOLETE memcpy (valaddr_data, VALUE_CONTENTS (arg2), */
- /* OBSOLETE count2 * TYPE_LENGTH (eltype2)); */
- /* OBSOLETE *//* Zero the rest of the __var_data field of val. */
- /* OBSOLETE memset (valaddr_data + count2 * TYPE_LENGTH (eltype2), '\0', */
- /* OBSOLETE (count1 - count2) * TYPE_LENGTH (eltype2)); */
- /* OBSOLETE return val; */
- /* OBSOLETE } */
else if (VALUE_LVAL (arg2) == lval_memory)
{
return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2),
@@ -2163,22 +2120,23 @@ search_struct_field (char *name, struct value *arg1, int offset,
/* Look for a match through the fields of an anonymous union,
or anonymous struct. C++ provides anonymous unions.
- In the GNU Chill (OBSOLETE) implementation of
- variant record types, each <alternative field> has
- an (anonymous) union type, each member of the union
- represents a <variant alternative>. Each <variant
- alternative> is represented as a struct, with a
- member for each <variant field>. */
+ In the GNU Chill (now deleted from GDB)
+ implementation of variant record types, each
+ <alternative field> has an (anonymous) union type,
+ each member of the union represents a <variant
+ alternative>. Each <variant alternative> is
+ represented as a struct, with a member for each
+ <variant field>. */
struct value *v;
int new_offset = offset;
/* This is pretty gross. In G++, the offset in an
anonymous union is relative to the beginning of the
- enclosing struct. In the GNU Chill (OBSOLETE)
- implementation of variant records, the bitpos is
- zero in an anonymous union field, so we have to add
- the offset of the union here. */
+ enclosing struct. In the GNU Chill (now deleted
+ from GDB) implementation of variant records, the
+ bitpos is zero in an anonymous union field, so we
+ have to add the offset of the union here. */
if (TYPE_CODE (field_type) == TYPE_CODE_STRUCT
|| (TYPE_NFIELDS (field_type) > 0
&& TYPE_FIELD_BITPOS (field_type, 0) == 0))
@@ -3406,9 +3364,6 @@ value_slice (struct value *array, int lowbound, int length)
error ("slice from bad array or bitstring");
if (lowbound < lowerbound || length < 0
|| lowbound + length - 1 > upperbound)
- /* OBSOLETE Chill allows zero-length strings but not arrays. */
- /* OBSOLETE || (current_language->la_language == language_chill */
- /* OBSOLETE && length == 0 && TYPE_CODE (array_type) == TYPE_CODE_ARRAY)) */
error ("slice out of range");
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
@@ -3464,19 +3419,6 @@ value_slice (struct value *array, int lowbound, int length)
return slice;
}
-/* Assuming OBSOLETE chill_varying_type (VARRAY) is true, return an
- equivalent value as a fixed-length array. */
-
-struct value *
-varying_to_slice (struct value *varray)
-{
- struct type *vtype = check_typedef (VALUE_TYPE (varray));
- LONGEST length = unpack_long (TYPE_FIELD_TYPE (vtype, 0),
- VALUE_CONTENTS (varray)
- + TYPE_FIELD_BITPOS (vtype, 0) / 8);
- return value_slice (value_primitive_field (varray, 0, 1, vtype), 0, length);
-}
-
/* Create a value for a FORTRAN complex number. Currently most of
the time values are coerced to COMPLEX*16 (i.e. a complex number
composed of 2 doubles. This really should be a smarter routine