struct type *elttype;
unsigned eltlen;
LONGEST val;
- unsigned char c;
CORE_ADDR addr;
switch (TYPE_CODE (type))
if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
&& (format == 0 || format == 's'))
{
- if (addressprint && format != 's')
- {
- fprintf_filtered (stream, "0x%x ", address);
- }
LA_PRINT_STRING (stream, valaddr, len, 0);
i = len;
}
break;
}
/* Array of unspecified length: treat like pointer to first elt. */
- valaddr = (char *) &address;
- /* FALL THROUGH */
+ addr = address;
+ goto print_unpacked_pointer;
case TYPE_CODE_PTR:
if (format && format != 's')
else
{
addr = unpack_pointer (type, valaddr);
+ print_unpacked_pointer:
elttype = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
if (addressprint && format != 's')
{
- fprintf_filtered (stream, "0x%x", addr);
+ fprintf_filtered (stream, "0x%lx", (unsigned long)addr);
}
/* For a pointer to char or unsigned char, also print the string
if (vtblprint)
{
value vt_val;
+ struct symbol *wsym = (struct symbol *)NULL;
+ struct type *wtype;
+ struct symtab *s;
+ struct block *block = (struct block *)NULL;
+ int is_this_fld;
- vt_val = value_at (TYPE_TARGET_TYPE (type), vt_address);
+
+ wsym = lookup_symbol (SYMBOL_NAME(msymbol), block,
+ VAR_NAMESPACE, &is_this_fld, &s);
+
+ if (wsym)
+ {
+ wtype = SYMBOL_TYPE(wsym);
+ }
+ else
+ {
+ wtype = TYPE_TARGET_TYPE(type);
+ }
+ vt_val = value_at (wtype, vt_address);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty);
print_address_demangle (address, stream, demangle);
break;
+ case TYPE_CODE_BOOL:
+ /* Do something at least vaguely reasonable, for example if the
+ language is set wrong. */
+
case TYPE_CODE_INT:
format = format ? format : output_format;
if (format)