Add DIETypeUnit.

Represents a top level unit from DWARF 4's .debug_types section, akin
to a compilation unit.
This commit is contained in:
Rene Gollent 2013-07-16 22:39:13 -04:00
parent cbf9b7b177
commit 18c9c018a1
2 changed files with 60 additions and 0 deletions

View File

@ -2527,6 +2527,42 @@ DIESharedType::AddAttribute_decl_column(uint16 attributeName,
}
// #pragma mark - DIETypeUnit
DIETypeUnit::DIETypeUnit()
:
fLanguage(0)
{
}
uint16
DIETypeUnit::Tag() const
{
return DW_TAG_type_unit;
}
status_t
DIETypeUnit::AddChild(DebugInfoEntry* child)
{
if (child->IsType())
fType = dynamic_cast<DIEType*>(child);
return B_OK;
}
status_t
DIETypeUnit::AddAttribute_language(uint16 attributeName,
const AttributeValue& value)
{
fLanguage = value.constant;
return B_OK;
}
// #pragma mark - DIETemplateTypeParameterPack
@ -2887,6 +2923,9 @@ DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry)
case DW_TAG_shared_type:
entry = new(std::nothrow) DIESharedType;
break;
case DW_TAG_type_unit:
entry = new(std::nothrow) DIETypeUnit;
break;
case DW_TAG_GNU_template_parameter_pack:
entry = new(std::nothrow) DIETemplateTypeParameterPack;
break;

View File

@ -1606,6 +1606,27 @@ private:
};
class DIETypeUnit : public DebugInfoEntry {
public:
DIETypeUnit();
virtual uint16 Tag() const;
uint16 Language() const { return fLanguage; }
virtual status_t AddChild(DebugInfoEntry* child);
virtual status_t AddAttribute_language(uint16 attributeName,
const AttributeValue& value);
inline DIEType* GetType() const { return fType; }
private:
uint16 fLanguage;
DIEType* fType;
};
class DIETemplateTypeParameterPack : public DIEDeclaredBase {
public:
DIETemplateTypeParameterPack();