aboutsummaryrefslogtreecommitdiff
path: root/gdb/convex-tdep.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-12-15 02:52:11 +0000
committerFred Fish <fnf@specifix.com>1992-12-15 02:52:11 +0000
commit85f0a8484fae7fc4f28b85298253e786645a5b6a (patch)
tree723472495b0c8155f5eb698d4bbb08cb935ebc69 /gdb/convex-tdep.c
parent7f70a2756406d76578fc4a6af98c42fd85f28b12 (diff)
downloadgdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.zip
gdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.tar.gz
gdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.tar.bz2
* gdbtypes.c (create_array_type): Complete rewrite. Now requires
a optional type to decorate as an array type, the type of the index, and the bounds of the array. Records this additional info in the array type for use with languages with nonzero array bounds. * gdbtypes.h (enum type_code): Update comment for TYPE_CODE_ARRAY to note that arrays may have bounds. * gdbtypes.h (create_array_type): Update prototype. * c-exp.y (ptype production): Adjust for new create_array_type calling conventions. * coffread.c (decode_type): Call create_array_type rather than handcrafting array types. * convex-tdep.c (value_type): Remove, now use create_array_type. * convex-tdep.c (value_of_trapped_internalvar): Convert calls to vector_type into calls to create_array_type. * dwarfread.c (decode_subscr_data): Name changed to decode_subscript_data_item throughout. * dwarfread.c (decode_subscript_data_item): Rewrite to use create_array_type. Now records index type and range as well. * dwarfread.c (dwarf_read_array_type): Rewrite as part of change to use create_array_type. * dwarfread.c (read_subroutine_type): Test existing user defined types before decorating them, to ensure they are blank, and complain about it if they are not. * dwarfread.c (decode_fund_type): For unrecognized types, always return some valid type (type integer). If the unrecognized type cannot be an implementation defined type, complain as well. * m88k-tdep.c (pushed_size): Update comment for TYPE_CODE_ARRAY. * m88k-tdep.c (store_param): Update comment for TYPE_CODE_ARRAY. * mipsread.c (upgrade_type): Add FIXME comment that code to handcraft arrays should be replaced with call to create_array_type. * stabsread.c (read_array_type): Replace code to handcraft array types with call to create_array_type. * valprint.c (type_print_varspec_prefix): Minor formatting change, join lines that don't need to be split.
Diffstat (limited to 'gdb/convex-tdep.c')
-rw-r--r--gdb/convex-tdep.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/gdb/convex-tdep.c b/gdb/convex-tdep.c
index ac213ae..a374a80 100644
--- a/gdb/convex-tdep.c
+++ b/gdb/convex-tdep.c
@@ -350,7 +350,8 @@ value_of_trapped_internalvar (var)
long vm[4];
long i, *p;
bcopy (read_vector_register_1 (VM_REGNUM), vm, sizeof vm);
- type = vector_type (builtin_type_int, len);
+ type = create_array_type ((struct type *) NULL, builtin_type_int,
+ builtin_type_int, 0, len - 1);
val = allocate_value (type);
p = (long *) VALUE_CONTENTS (val);
for (i = 0; i < len; i++)
@@ -358,7 +359,8 @@ value_of_trapped_internalvar (var)
}
else if (name[0] == 'V')
{
- type = vector_type (builtin_type_long_long, len);
+ type = create_array_type ((struct type *) NULL, builtin_type_long_long,
+ builtin_type_int, 0, len - 1);
val = allocate_value (type);
bcopy (read_vector_register_1 (name[1] - '0'),
VALUE_CONTENTS (val), TYPE_LENGTH (type));
@@ -366,7 +368,8 @@ value_of_trapped_internalvar (var)
else if (name[0] == 'v')
{
long *p1, *p2;
- type = vector_type (builtin_type_long, len);
+ type = create_array_type ((struct type *) NULL, builtin_type_long,
+ builtin_type_int, 0, len - 1);
val = allocate_value (type);
p1 = read_vector_register_1 (name[1] - '0');
p2 = (long *) VALUE_CONTENTS (val);
@@ -385,22 +388,6 @@ value_of_trapped_internalvar (var)
return val;
}
-/* Construct the type for a vector register's value --
- array[LENGTH] of ELEMENT_TYPE. */
-
-static struct type *
-vector_type (element_type, length)
- struct type *element_type;
- long length;
-{
- struct type *type = (struct type *) xmalloc (sizeof (struct type));
- bzero (type, sizeof type);
- TYPE_CODE (type) = TYPE_CODE_ARRAY;
- TYPE_TARGET_TYPE (type) = element_type;
- TYPE_LENGTH (type) = length * TYPE_LENGTH (TYPE_TARGET_TYPE (type));
- return type;
-}
-
/* Handle a new value assigned to a trapped internal variable */
void