- OS << '[' << getCode() << "] " << TagString(getTag()) << "\tDW_CHILDREN_"
- << (hasChildren() ? "yes" : "no") << '\n';
- for (unsigned i = 0, e = Attributes.size(); i != e; ++i)
- OS << '\t' << AttributeString(Attributes[i].getAttribute())
- << '\t' << FormEncodingString(Attributes[i].getForm()) << '\n';
+ const char *tagString = TagString(getTag());
+ OS << '[' << getCode() << "] ";
+ if (tagString)
+ OS << tagString;
+ else
+ OS << format("DW_TAG_Unknown_%x", getTag());
+ OS << "\tDW_CHILDREN_" << (hasChildren() ? "yes" : "no") << '\n';
+ for (const AttributeSpec &Spec : AttributeSpecs) {
+ OS << '\t';
+ const char *attrString = AttributeString(Spec.Attr);
+ if (attrString)
+ OS << attrString;
+ else
+ OS << format("DW_AT_Unknown_%x", Spec.Attr);
+ OS << '\t';
+ const char *formString = FormEncodingString(Spec.Form);
+ if (formString)
+ OS << formString;
+ else
+ OS << format("DW_FORM_Unknown_%x", Spec.Form);
+ OS << '\n';
+ }