* p-typeprint.c (pascal_type_print_base): Use TYPE_ERROR_NAME.
* m2-valprint.c (m2_val_print): Use TYPE_ERROR_NAME.
* gdbtypes.h (TYPE_ERROR_NAME): New macro.
* f-valprint.c (f_val_print): Use TYPE_ERROR_NAME.
* f-typeprint.c (f_type_print_base): Use TYPE_ERROR_NAME.
* dwarf2read.c (tag_type_to_type): Create a new error type on
failure.
* c-valprint.c (c_val_print): Use TYPE_ERROR_NAME.
* c-typeprint.c (c_type_print_base): Use TYPE_ERROR_NAME.
+2010-06-21 Tom Tromey <tromey@redhat.com>
+
+ * p-valprint.c (pascal_val_print): Use TYPE_ERROR_NAME.
+ * p-typeprint.c (pascal_type_print_base): Use TYPE_ERROR_NAME.
+ * m2-valprint.c (m2_val_print): Use TYPE_ERROR_NAME.
+ * gdbtypes.h (TYPE_ERROR_NAME): New macro.
+ * f-valprint.c (f_val_print): Use TYPE_ERROR_NAME.
+ * f-typeprint.c (f_type_print_base): Use TYPE_ERROR_NAME.
+ * dwarf2read.c (tag_type_to_type): Create a new error type on
+ failure.
+ * c-valprint.c (c_val_print): Use TYPE_ERROR_NAME.
+ * c-typeprint.c (c_type_print_base): Use TYPE_ERROR_NAME.
+
2010-06-21 Michael Snyder <msnyder@vmware.com>
* breakpoint.c (_initialize_breakpoint): Use add_prefix_cmd,
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, _("<unknown type>"));
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_RANGE:
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, _("<error type>"));
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_UNDEF:
this_type = read_type_die (die, cu);
if (!this_type)
{
- dump_die_for_error (die);
- error (_("Dwarf Error: Cannot find type of die [in module %s]"),
- cu->objfile->name);
+ char *message, *saved;
+
+ /* read_type_die already issued a complaint. */
+ message = xstrprintf (_("<unknown type in %s, CU 0x%x, DIE 0x%x>"),
+ cu->objfile->name,
+ cu->header.offset,
+ die->offset);
+ saved = obstack_copy0 (&cu->objfile->objfile_obstack,
+ message, strlen (message));
+ xfree (message);
+
+ this_type = init_type (TYPE_CODE_ERROR, 0, 0, saved, cu->objfile);
}
return this_type;
}
break;
case TYPE_CODE_ERROR:
- fprintfi_filtered (level, stream, "<unknown type>");
+ fprintfi_filtered (level, stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_RANGE:
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, "<error type>");
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_RANGE:
|| TYPE_NFN_FIELDS (thistype) == 0) && \
(TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
+/* A helper macro that returns the name of an error type. If the type
+ has a name, it is used; otherwise, a default is used. */
+#define TYPE_ERROR_NAME(type) \
+ (TYPE_NAME (type) ? TYPE_NAME (type) : _("<error type>"))
+
struct builtin_type
{
/* Integral types. */
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, _("<error type>"));
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_UNDEF:
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, "<unknown type>");
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
/* this probably does not work for enums */
break;
case TYPE_CODE_ERROR:
- fprintf_filtered (stream, "<error type>");
+ fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
case TYPE_CODE_UNDEF: