diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-10 14:48:39 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-08-10 14:48:39 -0700 |
commit | 7f17af5c9ace193eef48246bcadf42ae9650de67 (patch) | |
tree | 327acfe235e67925e3f21b54b5f5f3f798419fb4 /dwflpp.cxx | |
parent | 6a38401c78a02b9bd14e50966ecdd54a003597b7 (diff) | |
download | systemtap-steved-7f17af5c9ace193eef48246bcadf42ae9650de67.tar.gz systemtap-steved-7f17af5c9ace193eef48246bcadf42ae9650de67.tar.xz systemtap-steved-7f17af5c9ace193eef48246bcadf42ae9650de67.zip |
PR10499: Integrate attributes in dwarf_decl_file/line
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 those old versions, we define custom implementations to do the
integration.
* dwarf_wrappers.cxx (dwarf_decl_file_integrate): New.
(dwarf_decl_line_integrate): New.
* dwarf_wrappers.h: Add macros to redirect calls to the above functions.
* dwflpp.cxx (dwflpp::iterate_over_labels): Replace a manual attribute
lookup that is the same as dwarf_decl_line.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -978,11 +978,11 @@ dwflpp::iterate_over_labels (Dwarf_Die *begin_die, && function_name_matches_pattern (name, sym))) { const char *file = dwarf_decl_file (&die); + // Get the line number for this label - Dwarf_Attribute attr; - dwarf_attr (&die,DW_AT_decl_line, &attr); - Dwarf_Sword dline; - dwarf_formsdata (&attr, &dline); + int dline; + dwarf_decl_line (&die, &dline); + Dwarf_Addr stmt_addr; if (dwarf_lowpc (&die, &stmt_addr) != 0) { @@ -993,7 +993,7 @@ dwflpp::iterate_over_labels (Dwarf_Die *begin_die, size_t nlines = 0; // Get the line for this label Dwarf_Line **aline; - dwarf_getsrc_file (module_dwarf, file, (int)dline, 0, &aline, &nlines); + dwarf_getsrc_file (module_dwarf, file, dline, 0, &aline, &nlines); // Get the address for (size_t i = 0; i < nlines; i++) { @@ -1009,7 +1009,7 @@ dwflpp::iterate_over_labels (Dwarf_Die *begin_die, if (nscopes > 1) { callback(function_name.c_str(), file, - (int)dline, &scopes[1], stmt_addr, q); + dline, &scopes[1], stmt_addr, q); add_label_name(q, name); } } |