+ /* For a pointer to char or unsigned char, also print the string
+ pointed to, unless pointer is null. */
+ if (((TYPE_LENGTH (elttype) == 1
+ && (TYPE_CODE (elttype) == TYPE_CODE_INT
+ || TYPE_CODE (elttype) == TYPE_CODE_CHAR))
+ || ((TYPE_LENGTH (elttype) == 2 || TYPE_LENGTH (elttype) == 4)
+ && TYPE_CODE (elttype) == TYPE_CODE_CHAR))
+ && (options->format == 0 || options->format == 's')
+ && addr != 0)
+ {
+ /* No wide string yet. */
+ i = val_print_string (elttype, NULL, addr, -1, stream, options);
+ }
+ /* Also for pointers to pascal strings. */
+ /* Note: this is Free Pascal specific:
+ as GDB does not recognize stabs pascal strings
+ Pascal strings are mapped to records
+ with lowercase names PM. */
+ if (is_pascal_string_type (elttype, &length_pos, &length_size,
+ &string_pos, &char_type, NULL)
+ && addr != 0)
+ {
+ ULONGEST string_length;
+ void *buffer;
+
+ buffer = xmalloc (length_size);
+ read_memory (addr + length_pos, buffer, length_size);
+ string_length = extract_unsigned_integer (buffer, length_size,
+ byte_order);
+ xfree (buffer);
+ i = val_print_string (char_type, NULL,
+ addr + string_pos, string_length,
+ stream, options);
+ }
+ else if (pascal_object_is_vtbl_member (type))
+ {
+ /* Print vtbl's nicely. */
+ CORE_ADDR vt_address = unpack_pointer (type,
+ valaddr + embedded_offset);
+ struct minimal_symbol *msymbol =
+ lookup_minimal_symbol_by_pc (vt_address);
+
+ if ((msymbol != NULL)
+ && (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))