+2019-05-29 Tom Tromey <tromey@adacore.com>
+
+ * dwarf2read.c (partial_die_parent_scope): Call dwarf_tag_name.
+ (dwarf_unknown): New function.
+ (dwarf_tag_name, dwarf_attr_name, dwarf_form_name)
+ (dwarf_type_encoding_name): Use dwarf_unknown.
+
2019-05-29 Tom Tromey <tromey@adacore.com>
PR c++/20020:
/* FIXME drow/2004-04-01: What should we be doing with
function-local names? For partial symbols, we should probably be
ignoring them. */
- complaint (_("unhandled containing DIE tag %d for DIE at %s"),
- parent->tag, sect_offset_str (pdi->sect_off));
+ complaint (_("unhandled containing DIE tag %s for DIE at %s"),
+ dwarf_tag_name (parent->tag),
+ sect_offset_str (pdi->sect_off));
parent->scope = grandparent_scope;
}
return follow_die_ref (die, attr, ext_cu);
}
+/* A convenience function that returns an "unknown" DWARF name,
+ including the value of V. STR is the name of the entity being
+ printed, e.g., "TAG". */
+
+static const char *
+dwarf_unknown (const char *str, unsigned v)
+{
+ char *cell = get_print_cell ();
+ xsnprintf (cell, PRINT_CELL_SIZE, "DW_%s_<unknown: %u>", str, v);
+ return cell;
+}
+
/* Convert a DIE tag into its string name. */
static const char *
const char *name = get_DW_TAG_name (tag);
if (name == NULL)
- return "DW_TAG_<unknown>";
+ return dwarf_unknown ("TAG", tag);
return name;
}
name = get_DW_AT_name (attr);
if (name == NULL)
- return "DW_AT_<unknown>";
+ return dwarf_unknown ("AT", attr);
return name;
}
const char *name = get_DW_FORM_name (form);
if (name == NULL)
- return "DW_FORM_<unknown>";
+ return dwarf_unknown ("FORM", form);
return name;
}
const char *name = get_DW_ATE_name (enc);
if (name == NULL)
- return "DW_ATE_<unknown>";
+ return dwarf_unknown ("ATE", enc);
return name;
}