Debugger: Handle DW_TAG_GNU_template_template_param.

This is a GNU extension for identifying the case of a template parameter
that is itself a template. We don't currently make use of it, but this
allows us to parse/skip it correctly.

With this change, webcore is loadable/debuggable on x86-64 when built
with -gdwarf-4, with the caveat that ~3-4GB of RAM are currently required.
This commit is contained in:
Rene Gollent 2013-07-23 18:05:14 -04:00
parent b5ccadd7c2
commit 3b2c8f50dc
3 changed files with 54 additions and 0 deletions

View File

@ -2573,6 +2573,39 @@ DIETypeUnit::Tag() const
}
// #pragma mark - DIETemplateTemplateParameter
DIETemplateTemplateParameter::DIETemplateTemplateParameter()
:
fName(NULL)
{
}
uint16
DIETemplateTemplateParameter::Tag() const
{
return DW_TAG_GNU_template_template_param;
}
const char*
DIETemplateTemplateParameter::Name() const
{
return fName;
}
status_t
DIETemplateTemplateParameter::AddAttribute_name(uint16 attributeName,
const AttributeValue& value)
{
fName = value.string;
return B_OK;
}
// #pragma mark - DIETemplateTypeParameterPack
@ -2936,6 +2969,9 @@ DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry)
case DW_TAG_type_unit:
entry = new(std::nothrow) DIETypeUnit;
break;
case DW_TAG_GNU_template_template_param:
entry = new(std::nothrow) DIETemplateTemplateParameter;
break;
case DW_TAG_GNU_template_parameter_pack:
entry = new(std::nothrow) DIETemplateTypeParameterPack;
break;

View File

@ -1633,6 +1633,22 @@ public:
};
class DIETemplateTemplateParameter : public DIEDeclaredBase {
public:
DIETemplateTemplateParameter();
virtual uint16 Tag() const;
virtual const char* Name() const;
virtual status_t AddAttribute_name(uint16 attributeName,
const AttributeValue& value);
private:
const char* fName;
};
class DIETemplateTypeParameterPack : public DIEDeclaredBase {
public:
DIETemplateTypeParameterPack();

View File

@ -69,6 +69,8 @@ enum {
DW_TAG_rvalue_reference_type = 0x42,
DW_TAG_template_alias = 0x43,
DW_TAG_lo_user = 0x4080,
DW_TAG_GNU_template_template_param
= 0x4106,
DW_TAG_GNU_template_parameter_pack
= 0x4107,
DW_TAG_GNU_formal_parameter_pack