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]

Some more libdw/c++ support for GNU_call_site


Hi,

I pushed some slightly higher level support for DW_TAG_GNU_call_site and
friends to the dwarf branch. Should have posted here. dwarflint doesn't
really check the requirements, but at least should not complain too
loudly when it encounters these new tags and attributes now.

Cheers,

Mark
commit bafccb5ed2304208dc38c5c83d15ec176fc3f3a7
Author: Mark Wielaard <mjw@redhat.com>
Date:   Wed Mar 30 17:09:17 2011 +0200

    Add DW_AT_GNU_call attributes to dwarf-knowledge.cc.
    
    DW_AT_GNU_call_site_value, DW_AT_GNU_call_site_data_value,
    DW_AT_GNU_call_site_target and DW_AT_GNU_call_site_target_clobbered
    describe locations. DW_AT_GNU_tail_call, DW_AT_GNU_all_tail_call_sites,
    DW_AT_GNU_all_call_sites and DW_AT_GNU_all_source_call_sites are flags.

diff --git a/libdw/c++/dwarf-knowledge.cc b/libdw/c++/dwarf-knowledge.cc
index 53cf1a1..48595a8 100644
--- a/libdw/c++/dwarf-knowledge.cc
+++ b/libdw/c++/dwarf-knowledge.cc
@@ -39,6 +39,10 @@ expected_value_space (int attr, int tag)
     case DW_AT_segment:
     case DW_AT_static_link:
     case DW_AT_vtable_elem_location:
+    case DW_AT_GNU_call_site_value:
+    case DW_AT_GNU_call_site_data_value:
+    case DW_AT_GNU_call_site_target:
+    case DW_AT_GNU_call_site_target_clobbered:
       return VS(location);
 
     case DW_AT_data_member_location:
@@ -120,6 +124,10 @@ expected_value_space (int attr, int tag)
     case DW_AT_elemental:
     case DW_AT_pure:
     case DW_AT_recursive:
+    case DW_AT_GNU_tail_call:
+    case DW_AT_GNU_all_tail_call_sites:
+    case DW_AT_GNU_all_call_sites:
+    case DW_AT_GNU_all_source_call_sites:
       return VS(flag);
 
     case DW_AT_producer:

commit 2875be68b435ce691ed33fc726c68796f185b6d0
Author: Mark Wielaard <mjw@redhat.com>
Date:   Wed Mar 30 19:53:21 2011 +0200

    dwarflint: Add GNU_call attributes and tags to expected-at.cc.

diff --git a/dwarflint/expected-at.cc b/dwarflint/expected-at.cc
index b3442d6..855c5c1 100644
--- a/dwarflint/expected-at.cc
+++ b/dwarflint/expected-at.cc
@@ -191,6 +191,9 @@ expected_at_map::expected_at_map ()
     .optional (DW_AT_sibling)
     .optional (DW_AT_static_link)
     .optional (DW_AT_type)
+    .optional (DW_AT_GNU_all_tail_call_sites)
+    .optional (DW_AT_GNU_all_call_sites)
+    .optional (DW_AT_GNU_all_source_call_sites)
     ;
 
   m_map [DW_TAG_enumeration_type]
@@ -570,6 +573,9 @@ expected_at_map::expected_at_map ()
     .optional (DW_AT_vtable_elem_location)
     .optional (DW_AT_MIPS_linkage_name) // XXX added to reflect reality
     .optional (DW_AT_containing_type) // XXX added to reflect reality
+    .optional (DW_AT_GNU_all_tail_call_sites)
+    .optional (DW_AT_GNU_all_call_sites)
+    .optional (DW_AT_GNU_all_source_call_sites)
     ;
 
   m_map [DW_TAG_subrange_type]
@@ -757,4 +763,28 @@ expected_at_map::expected_at_map ()
     .optional (DW_AT_type)
     .optional (DW_AT_visibility)
     ;
+
+  m_map [DW_TAG_GNU_call_site]
+    .optional (DW_AT_abstract_origin)
+    .optional (DW_AT_call_column)
+    .optional (DW_AT_call_file)
+    .optional (DW_AT_call_line)
+    .optional (DW_AT_GNU_call_site_target)
+    .optional (DW_AT_GNU_call_site_target_clobbered)
+    .required (DW_AT_low_pc)
+    .optional (DW_AT_sibling)
+    .optional (DW_AT_GNU_tail_call)
+    .optional (DW_AT_type)
+    ;
+
+  m_map [DW_TAG_GNU_call_site_parameter]
+    .optional (DW_AT_abstract_origin)
+    .optional (DW_AT_GNU_call_site_data_value)
+    .optional (DW_AT_GNU_call_site_value)
+    .optional (DW_AT_data_location)
+    .required (DW_AT_location)
+    .optional (DW_AT_name)
+    .optional (DW_AT_sibling)
+    .optional (DW_AT_type)
+    ;
 }

commit df79fab07b38ca4f97529f51d8fdc63a52987925
Author: Mark Wielaard <mjw@redhat.com>
Date:   Fri Apr 1 00:17:58 2011 +0200

    dwarflint: check_dups_abstract_origin, some (GNU_call_site) dups are OK.
    
    A call site entry has a DW_AT_low_pc attribute which is the return
    address after the call and a DW_AT_abstract_origin that is a
    pointer to the reference it calls directly or indirectly.

diff --git a/dwarflint/check_dups_abstract_origin.cc b/dwarflint/check_dups_abstract_origin.cc
index 3142ba1..1499572 100644
--- a/dwarflint/check_dups_abstract_origin.cc
+++ b/dwarflint/check_dups_abstract_origin.cc
@@ -54,6 +54,19 @@ namespace
       return &cd;
     }
 
+    bool
+    duplicate_ok (int tag, int at, int from)
+    {
+      // A call site entry has a DW_AT_low_pc attribute which is the return
+      // address after the call and a DW_AT_abstract_origin that is a
+      // pointer to the reference it calls directly or indirectly.
+      if (tag == DW_TAG_GNU_call_site)
+	if (at == DW_AT_low_pc && from == DW_AT_abstract_origin)
+	  return true;
+
+      return false;
+    }
+
     void
     check_die_attr (dwarf::debug_info_entry const &die,
 		    dwarf::attribute const &attr)
@@ -72,7 +85,8 @@ namespace
       for (dwarf::debug_info_entry::attributes_type::const_iterator
 	     at = referree.attributes ().begin ();
 	   at != referree.attributes ().end (); ++at)
-	if ((at2 = m.find ((*at).first)) != m.end ())
+	if ((at2 = m.find ((*at).first)) != m.end ()
+	    && ! duplicate_ok (die.tag (), at2->first, attr.first))
 	  wr_message (to_where (die), mc_impact_3 | mc_acc_bloat | mc_die_rel)
 	    << "Attribute " << dwarf::attributes::name (at2->first)
 	    << " is duplicated at " << dwarf::attributes::name (attr.first)

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