summaryrefslogtreecommitdiffstats
path: root/dwarf_wrappers.h
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-19 17:27:18 -0700
committerJosh Stone <jistone@redhat.com>2009-08-19 17:27:18 -0700
commit3d1ad34033e6f77368287927049e112d9ee3677e (patch)
tree6ddc1b1ae665ed6be9a01b81d142f048c2b063d8 /dwarf_wrappers.h
parentde9a66e3bbc3f287229cad892108e46ac44b2bdf (diff)
downloadsystemtap-steved-3d1ad34033e6f77368287927049e112d9ee3677e.tar.gz
systemtap-steved-3d1ad34033e6f77368287927049e112d9ee3677e.tar.xz
systemtap-steved-3d1ad34033e6f77368287927049e112d9ee3677e.zip
Create a dwarf_attr_die idiom
We commonly do a dwarf_attr_integrate followed by dwarf_formref_die, with no care for the Dwarf_Attribute, so I captured that idiom in an inline function. * dwarf_wrappers.h (dwarf_attr_die): New. * dwarf_wrappers.cxx (dwarf_type_name): Call dwarf_attr_die. * dwflpp.cxx (dwflpp::print_members): Ditto. (dwflpp::find_struct_member): Ditto. * tapsets.cxx (dwarf_derived_probe::saveargs): Ditto. (uprobe_derived_probe::saveargs): Ditto. (resolve_tracepoint_arg_type): Ditto. (tracepoint_derived_probe::build_args): Ditto.
Diffstat (limited to 'dwarf_wrappers.h')
-rw-r--r--dwarf_wrappers.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/dwarf_wrappers.h b/dwarf_wrappers.h
index bc1cde2b..766abb6d 100644
--- a/dwarf_wrappers.h
+++ b/dwarf_wrappers.h
@@ -103,6 +103,16 @@ public:
};
+// Look up the DIE for a reference-form attribute name
+inline Dwarf_Die *
+dwarf_attr_die (Dwarf_Die *die, unsigned int attr, Dwarf_Die *result)
+{
+ Dwarf_Attribute attr_mem;
+ return dwarf_formref_die (dwarf_attr_integrate (die, attr, &attr_mem),
+ result);
+}
+
+
#if !_ELFUTILS_PREREQ(0, 143)
// Elfutils prior to 0.143 didn't use attr_integrate when looking up the
// decl_file or decl_line, so the attributes would sometimes be missed. For