aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
committerFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
commitec16f7015b91a7324011b41f6a13dfab0fd5d21a (patch)
treee7f4babdb56207372200a6e11c3f46b4bbcacb97 /gdb/gdbtypes.c
parentfa2b89f1032989451742a5a75bcdec34736f903a (diff)
downloadgdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.zip
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.gz
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.bz2
* c-exp.y (exp): Add production to support direct creation
of array constants using the obvious syntax. * c-valprint.c (c_val_print): Set printed string length. * dwarfread.c (read_tag_string_type): New prototype and function that handles TAG_string_type DIEs. * dwarfread.c (process_dies): Add case for TAG_string_type that calls new read_tag_string_type function. * expprint.c (print_subexp): Add support for OP_ARRAY. * gdbtypes.c (create_range_type, create_array_type): Inherit objfile from the index type. **** start-sanitize-chill **** * ch-typeprint.c (chill_print_type): Add case for TYPE_CODE_STRING. * ch-valprint.c (chill_val_print): Fix case for TYPE_CODE_STRING. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 525c515..b5caccf 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -314,8 +314,10 @@ allocate_stub_method (type)
}
/* Create a range type using either a blank type supplied in RESULT_TYPE,
- or creating a new type. Indices will be of type INDEX_TYPE, and will
- range from LOW_BOUND to HIGH_BOUND, inclusive.
+ or creating a new type, inheriting the objfile from INDEX_TYPE.
+
+ Indices will be of type INDEX_TYPE, and will range from LOW_BOUND to
+ HIGH_BOUND, inclusive.
FIXME: Maybe we should check the TYPE_CODE of RESULT_TYPE to make
sure it is TYPE_CODE_UNDEF before we bash it into a range type? */
@@ -348,8 +350,10 @@ create_range_type (result_type, index_type, low_bound, high_bound)
/* Create an array type using either a blank type supplied in RESULT_TYPE,
- or creating a new type. Elements will be of type ELEMENT_TYPE, the
- indices will be of type RANGE_TYPE.
+ or creating a new type, inheriting the objfile from RANGE_TYPE.
+
+ Elements will be of type ELEMENT_TYPE, the indices will be of type
+ RANGE_TYPE.
FIXME: Maybe we should check the TYPE_CODE of RESULT_TYPE to make
sure it is TYPE_CODE_UNDEF before we bash it into an array type? */
@@ -374,7 +378,7 @@ create_array_type (result_type, element_type, range_type)
}
if (result_type == NULL)
{
- result_type = alloc_type (TYPE_OBJFILE (element_type));
+ result_type = alloc_type (TYPE_OBJFILE (range_type));
}
TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
TYPE_TARGET_TYPE (result_type) = element_type;