diff options
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b53e649..0aa9113 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1841,6 +1841,7 @@ is_dynamic_type_internal (struct type *type, int top_level) } case TYPE_CODE_ARRAY: + case TYPE_CODE_STRING: { gdb_assert (TYPE_NFIELDS (type) == 1); @@ -1945,7 +1946,8 @@ resolve_dynamic_array (struct type *type, struct type *ary_dim; struct dynamic_prop *prop; - gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY); + gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY + || TYPE_CODE (type) == TYPE_CODE_STRING); type = copy_type (type); @@ -1970,13 +1972,17 @@ resolve_dynamic_array (struct type *type, ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); - if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY) + if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY + || TYPE_CODE (ary_dim) == TYPE_CODE_STRING)) elt_type = resolve_dynamic_array (ary_dim, addr_stack); else elt_type = TYPE_TARGET_TYPE (type); - return create_array_type_with_stride (type, elt_type, range_type, - TYPE_FIELD_BITSIZE (type, 0)); + if (TYPE_CODE (type) == TYPE_CODE_STRING) + return create_string_type (type, elt_type, range_type); + else + return create_array_type_with_stride (type, elt_type, range_type, + TYPE_FIELD_BITSIZE (type, 0)); } /* Resolve dynamic bounds of members of the union TYPE to static @@ -2181,6 +2187,7 @@ resolve_dynamic_type_internal (struct type *type, break; case TYPE_CODE_ARRAY: + case TYPE_CODE_STRING: resolved_type = resolve_dynamic_array (type, addr_stack); break; |