extern int demangle; /* whether to print C++ syms raw or src-form */
extern void
-cp_print_class_member PARAMS ((char *, struct type *, FILE *, char *));
+cp_print_class_member PARAMS ((char *, struct type *, GDB_FILE *, char *));
extern void
-cp_print_class_method PARAMS ((char *, struct type *, FILE *));
+cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
extern void
-cp_print_value_fields PARAMS ((struct type *, char *, FILE *, int, int,
+cp_print_value_fields PARAMS ((struct type *, char *, GDB_FILE *, int, int,
enum val_prettyprint, struct type **));
extern int
/* BEGIN-FIXME: Hooks into c-typeprint.c */
extern void
-c_type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
+c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
extern void
cp_type_print_method_args PARAMS ((struct type **, char *, char *, int,
- FILE *));
+ GDB_FILE *));
/* END-FIXME */
struct type *type;
char *valaddr;
CORE_ADDR address;
- FILE *stream;
+ GDB_FILE *stream;
int format;
int deref_ref;
int recurse;
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
fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
fputs_filtered (">", stream);
}
- if (vtblprint)
+ if (vt_address && vtblprint)
{
value vt_val;
-
- vt_val = value_at (TYPE_TARGET_TYPE (type), vt_address);
+ struct symbol *wsym = (struct symbol *)NULL;
+ struct type *wtype;
+ struct symtab *s;
+ struct block *block = (struct block *)NULL;
+ int is_this_fld;
+
+ if (msymbol != NULL)
+ 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);
break;
}
len = TYPE_NFIELDS (type);
- val = unpack_long (builtin_type_int, valaddr);
+ val = unpack_long (type, valaddr);
for (i = 0; i < len; i++)
{
QUIT;
}
else
{
-#ifdef LONG_LONG
- fprintf_filtered (stream, "%lld", val);
-#else
- fprintf_filtered (stream, "%ld", val);
-#endif
+ print_longest (stream, 'd', 0, val);
}
break;
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)
default:
error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type));
}
- fflush (stream);
+ gdb_flush (stream);
return (0);
}