summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
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 /dwflpp.cxx
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 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index dcf04678..dce19f21 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -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)