diff options
author | Per Bothner <per@bothner.com> | 1994-09-16 07:29:44 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1994-09-16 07:29:44 +0000 |
commit | 576f97700b15b15f404fee452f862b1949cb30de (patch) | |
tree | f91841baf3db20cedf82b619fdc68f9583693450 /gdb/gdbtypes.c | |
parent | bdef6b60f3f6c9e44b2a5c66a95466e82be9a21e (diff) | |
download | gdb-576f97700b15b15f404fee452f862b1949cb30de.zip gdb-576f97700b15b15f404fee452f862b1949cb30de.tar.gz gdb-576f97700b15b15f404fee452f862b1949cb30de.tar.bz2 |
* stabsread.c (read_type): Handle stub types for bitstrings.
* stabsread.c (read_array_type): Check for stub domain type
using TYPE_FLAG_STUB, not its length.
* gdbtypes.c (create_set_type): Handle a stub domain type.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index a87d9a1..c386a42 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -466,24 +466,23 @@ create_set_type (result_type, domain_type) { result_type = alloc_type (TYPE_OBJFILE (domain_type)); } - domain_type = force_to_range_type (domain_type); TYPE_CODE (result_type) = TYPE_CODE_SET; TYPE_NFIELDS (result_type) = 1; TYPE_FIELDS (result_type) = (struct field *) TYPE_ALLOC (result_type, 1 * sizeof (struct field)); memset (TYPE_FIELDS (result_type), 0, sizeof (struct field)); + + if (! (TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB)) + { + domain_type = force_to_range_type (domain_type); + low_bound = TYPE_LOW_BOUND (domain_type); + high_bound = TYPE_HIGH_BOUND (domain_type); + bit_length = high_bound - low_bound + 1; + TYPE_LENGTH (result_type) + = ((bit_length + TARGET_INT_BIT - 1) / TARGET_INT_BIT) + * TARGET_CHAR_BIT; + } TYPE_FIELD_TYPE (result_type, 0) = domain_type; - low_bound = TYPE_LOW_BOUND (domain_type); - high_bound = TYPE_HIGH_BOUND (domain_type); - bit_length = high_bound - low_bound + 1; - if (bit_length <= TARGET_CHAR_BIT) - TYPE_LENGTH (result_type) = 1; - else if (bit_length <= TARGET_SHORT_BIT) - TYPE_LENGTH (result_type) = TARGET_SHORT_BIT / TARGET_CHAR_BIT; - else - TYPE_LENGTH (result_type) - = ((bit_length + TARGET_INT_BIT - 1) / TARGET_INT_BIT) - * TARGET_CHAR_BIT; return (result_type); } |