From 3d1ad34033e6f77368287927049e112d9ee3677e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 19 Aug 2009 17:27:18 -0700 Subject: 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. --- dwarf_wrappers.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'dwarf_wrappers.cxx') diff --git a/dwarf_wrappers.cxx b/dwarf_wrappers.cxx index fe8ead07..7b64aac5 100644 --- a/dwarf_wrappers.cxx +++ b/dwarf_wrappers.cxx @@ -125,10 +125,8 @@ dwarf_type_name(Dwarf_Die *type_die, ostringstream& o) // recurse into the referent type // if it can't be named, just call it "void" - Dwarf_Attribute subtype_attr; Dwarf_Die subtype_die; - if (!dwarf_attr_integrate(type_die, DW_AT_type, &subtype_attr) - || !dwarf_formref_die(&subtype_attr, &subtype_die) + if (!dwarf_attr_die(type_die, DW_AT_type, &subtype_die) || !dwarf_type_name(&subtype_die, o)) o.str("void"), o.seekp(4); -- cgit