aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-03-29 01:11:45 +0000
committerPer Bothner <per@bothner.com>1995-03-29 01:11:45 +0000
commite55a579687331adfe9a5f46d115a903a87451284 (patch)
treebd9f540c637c14cd34031ab80f7e2e642e837942 /gdb/gdbtypes.c
parent7d777b91ad1899323f4e61354ef67058ff583a1e (diff)
downloadgdb-e55a579687331adfe9a5f46d115a903a87451284.zip
gdb-e55a579687331adfe9a5f46d115a903a87451284.tar.gz
gdb-e55a579687331adfe9a5f46d115a903a87451284.tar.bz2
* gdbtypes.c (create_range_type): If indextype has TYPE_FLAG_STUB
set, set TYPE_FLAG_TARGET_STUB. (check_stub_type): Recalculate TYPE_LENGTH for range type. * stabsread.c (read_range_type): If index type number is followed by '=', back up, call read_type. and assume we have a true range. * gdbtypes.h (TYPE_FLAG_TARGET_STUB): Update comment. This fixes PR 6632.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 1a281c8..f5a8c3f 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -320,7 +320,10 @@ create_range_type (result_type, index_type, low_bound, high_bound)
}
TYPE_CODE (result_type) = TYPE_CODE_RANGE;
TYPE_TARGET_TYPE (result_type) = index_type;
- TYPE_LENGTH (result_type) = TYPE_LENGTH (index_type);
+ if (TYPE_FLAGS (index_type) & TYPE_FLAG_STUB)
+ TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB;
+ else
+ TYPE_LENGTH (result_type) = TYPE_LENGTH (index_type);
TYPE_NFIELDS (result_type) = 2;
TYPE_FIELDS (result_type) = (struct field *)
TYPE_ALLOC (result_type, 2 * sizeof (struct field));
@@ -890,11 +893,12 @@ check_stub_type (type)
struct type *range_type;
check_stub_type (TYPE_TARGET_TYPE (type));
- if (!(TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_STUB)
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_NFIELDS (type) == 1
- && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
- == TYPE_CODE_RANGE))
+ if (TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_STUB)
+ { }
+ else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && TYPE_NFIELDS (type) == 1
+ && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_RANGE))
{
/* Now recompute the length of the array type, based on its
number of elements and the target type's length. */
@@ -905,6 +909,11 @@ check_stub_type (type)
* TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB;
}
+ else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
+ {
+ TYPE_LENGTH (type) = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
+ TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB;
+ }
}
}