This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Added minimal support for DW_TAG_GNU_template


Hi,

I added minimal support to the dwarf branch for DW_TAG_GNU_template.
This is just enough to make sure that the various dwarf binaries don't
barf when they encounter the unknown attribute. And to make sure there
is a reference in the archive to the actual description:
http://gcc.gnu.org/wiki/TemplateParmsDwarf

Cheers,

Mark
diff --git a/dwarflint/dwarf_gnu.cc b/dwarflint/dwarf_gnu.cc
index b70a6d2..2d29f11 100644
--- a/dwarflint/dwarf_gnu.cc
+++ b/dwarflint/dwarf_gnu.cc
@@ -68,7 +68,8 @@ namespace
       // http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo
       add (const_attribute (DW_AT_GNU_odr_signature));
 
-      add (string_attribute (DW_AT_GNU_template_name)); // xxx ???
+      // http://gcc.gnu.org/wiki/TemplateParmsDwarf
+      add (string_attribute (DW_AT_GNU_template_name));
 
       // GNU extensions for representation of call sites
       // http://www.dwarfstd.org/ShowIssue.php?issue=100909.2
diff --git a/dwarflint/expected-at.cc b/dwarflint/expected-at.cc
index 70f1390..7a433c7 100644
--- a/dwarflint/expected-at.cc
+++ b/dwarflint/expected-at.cc
@@ -788,4 +788,23 @@ expected_at_map::expected_at_map ()
     .optional (DW_AT_sibling)
     .optional (DW_AT_type)
     ;
+
+  // http://gcc.gnu.org/wiki/TemplateParmsDwarf
+  m_map [DW_TAG_GNU_template_template_param]
+    .required (DW_AT_name)
+    .required (DW_AT_GNU_template_name)
+    ;
+
+  m_map [DW_TAG_GNU_template_parameter_pack]
+    .optional (at_set_decl)
+    .optional (DW_AT_name)
+    .optional (DW_AT_sibling)
+    ;
+
+  m_map [DW_TAG_GNU_formal_parameter_pack]
+    .optional (at_set_decl)
+    .optional (DW_AT_name)
+    .optional (DW_AT_sibling)
+    ;
+
 }
diff --git a/libdw/c++/dwarf-knowledge.cc b/libdw/c++/dwarf-knowledge.cc
index c38a169..c49e618 100644
--- a/libdw/c++/dwarf-knowledge.cc
+++ b/libdw/c++/dwarf-knowledge.cc
@@ -162,6 +162,7 @@ expected_value_space (int attr, int tag)
 
     case DW_AT_linkage_name:
     case DW_AT_MIPS_linkage_name:
+    case DW_AT_GNU_template_name:
       return VS(identifier);
 
     case DW_AT_GNU_odr_signature:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]