forked from Imagelibrary/binutils-gdb
Fix TYPE_HIGH_BOUND for TYPE_CODE_RANGE using arbitrary TYPE_NFIELDS in
preparation for supporting DW_AT_byte_stride. * ada-lang.c (packed_array_type, ada_index_type): Use TYPE_INDEX_TYPE. (ada_array_bound_from_type): Move `index_type' declaration to the function start. New variable `retval'. Return the bounds for TYPE_CODE_RANGE using TYPE_LOW_BOUND and TYPE_HIGH_BOUND. Abort on invalid index type codes. * ada-typeprint.c (print_range): Set `upper_bound' for TYPE_CODE_RANGE now using TYPE_HIGH_BOUND. * ada-valprint.c (val_print_packed_array_elements): Use `index_type'. * eval.c (evaluate_subexp_standard): Use TYPE_INDEX_TYPE. * gdbtypes.c (create_range_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND, refer to the number of fields only through TYPE_NFIELDS. (create_array_type): Use TYPE_INDEX_TYPE. (check_typedef): Use TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND. * gdbtypes.h (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED) (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): Use TYPE_INDEX_TYPE. (TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): Use TYPE_INDEX_TYPE, TYPE_LOW_BOUND, TYPE_HIGH_BOUND, * hppa-tdep.c (hppa_alignof <TYPE_CODE_ARRAY>): Use TYPE_INDEX_TYPE. * mdebugread.c (parse_type): Use TYPE_LOW_BOUND, TYPE_HIGH_BOUND, * valarith.c (value_bit_index): Use TYPE_INDEX_TYPE.
This commit is contained in:
@@ -815,15 +815,15 @@ extern void allocate_cplus_struct_type (struct type *);
|
||||
/* Moto-specific stuff for FORTRAN arrays */
|
||||
|
||||
#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
(TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),1))
|
||||
(TYPE_FIELD_ARTIFICIAL(TYPE_INDEX_TYPE((arraytype)),1))
|
||||
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
(TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),0))
|
||||
(TYPE_FIELD_ARTIFICIAL(TYPE_INDEX_TYPE((arraytype)),0))
|
||||
|
||||
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
|
||||
(TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),1))
|
||||
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
|
||||
|
||||
#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
|
||||
(TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),0))
|
||||
(TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype))))
|
||||
|
||||
/* C++ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user