+ try
+ {
+ struct type *type = type_object_to_type (self_string->type);
+ struct type *realtype;
+
+ gdb_assert (type != NULL);
+ realtype = check_typedef (type);
+ switch (realtype->code ())
+ {
+ case TYPE_CODE_PTR:
+ /* If a length is specified we need to convert this to an array
+ of the specified size. */
+ if (self_string->length != -1)
+ {
+ /* PR 20786: There's no way to specify an array of length zero.
+ Record a length of [0,-1] which is how Ada does it. Anything
+ we do is broken, but this is one possible solution. */
+ type = lookup_array_range_type (TYPE_TARGET_TYPE (realtype),
+ 0, self_string->length - 1);
+ val = value_at_lazy (type, self_string->address);
+ }
+ else
+ val = value_from_pointer (type, self_string->address);
+ break;
+ default:
+ val = value_at_lazy (type, self_string->address);
+ break;
+ }
+ }
+ catch (const gdb_exception &except)