From 3b2c8f50dc25515e0f21ad2b9441ec1bb47afbd9 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 23 Jul 2013 18:05:14 -0400 Subject: [PATCH] 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. --- src/apps/debugger/dwarf/DebugInfoEntries.cpp | 36 ++++++++++++++++++++ src/apps/debugger/dwarf/DebugInfoEntries.h | 16 +++++++++ src/apps/debugger/dwarf/Dwarf.h | 2 ++ 3 files changed, 54 insertions(+) diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index dd0d1d975f..4c52889890 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -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; diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h b/src/apps/debugger/dwarf/DebugInfoEntries.h index 8dbd2c486e..66eb2dbbf2 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.h +++ b/src/apps/debugger/dwarf/DebugInfoEntries.h @@ -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(); diff --git a/src/apps/debugger/dwarf/Dwarf.h b/src/apps/debugger/dwarf/Dwarf.h index 1fbfc2fb5b..491132cebd 100644 --- a/src/apps/debugger/dwarf/Dwarf.h +++ b/src/apps/debugger/dwarf/Dwarf.h @@ -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