diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-19 17:27:18 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-08-19 17:27:18 -0700 |
commit | 3d1ad34033e6f77368287927049e112d9ee3677e (patch) | |
tree | 6ddc1b1ae665ed6be9a01b81d142f048c2b063d8 /dwflpp.cxx | |
parent | de9a66e3bbc3f287229cad892108e46ac44b2bdf (diff) | |
download | systemtap-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 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -1588,10 +1588,7 @@ dwflpp::print_members(Dwarf_Die *vardie, ostream &o) else { Dwarf_Die temp_die; - Dwarf_Attribute temp_attr; - - if (!dwarf_attr_integrate (die, DW_AT_type, &temp_attr) || - !dwarf_formref_die (&temp_attr, &temp_die)) + if (!dwarf_attr_die (die, DW_AT_type, &temp_die)) { string source = dwarf_decl_file(die) ?: "<unknown source>"; int line = -1; @@ -1642,12 +1639,8 @@ dwflpp::find_struct_member(const target_symbol::component& c, { // need to recurse for anonymous structs/unions Dwarf_Die subdie; - - if (!dwarf_attr_integrate (&die, DW_AT_type, &attr) || - !dwarf_formref_die (&attr, &subdie)) - continue; - - if (find_struct_member(c, &subdie, memberdie, locs)) + if (dwarf_attr_die (&die, DW_AT_type, &subdie) && + find_struct_member(c, &subdie, memberdie, locs)) goto success; } else if (name == c.member) |