]> sourceware.org Git - systemtap.git/commitdiff
Zap dwarf_diename_integrate
authorJosh Stone <jistone@redhat.com>
Sat, 8 Aug 2009 01:51:19 +0000 (18:51 -0700)
committerJosh Stone <jistone@redhat.com>
Sat, 8 Aug 2009 01:51:19 +0000 (18:51 -0700)
The dwarf_diename in elfutils learned a long time ago to use
dwarf_attr_integrate when looking up the name.  Our minimum elfutils
0.126 has this, so we don't need to kludge it ourselves.

dwarf_wrappers.cxx
dwarf_wrappers.h
dwflpp.cxx
loc2c-test.c
tapsets.cxx

index d7183dc33d02f64c0bfa7c5f620e7ed5d7d7da01..03979ca25c3ff58808a5b3f12df334e5e1b7b239 100644 (file)
@@ -47,15 +47,4 @@ void dwfl_assert(const std::string& desc, bool condition)
 }
 
 
-// Helper for dealing with selected portions of libdwfl in a more readable
-// fashion, and with specific cleanup / checking / logging options.
-
-const char *
-dwarf_diename_integrate (Dwarf_Die *die)
-{
-  Dwarf_Attribute attr_mem;
-  return dwarf_formstring (dwarf_attr_integrate (die, DW_AT_name, &attr_mem));
-}
-
-
 /* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */
index 1442a17c1a40eca60ae7066294afee21d4ed45dd..959ece92317f317ebdf55ad3d940e98557693eb9 100644 (file)
@@ -89,8 +89,6 @@ public:
   }
 };
 
-const char *dwarf_diename_integrate (Dwarf_Die *die);
-
 
 #endif
 
index ff62265f76166deb4f48bd4e0481a6b10385098e..9d0f3f4dfa321987c2ac90022aab0e184f993fb1 100644 (file)
@@ -1561,7 +1561,7 @@ dwflpp::print_members(Dwarf_Die *vardie, ostream &o)
   if (typetag != DW_TAG_structure_type && typetag != DW_TAG_union_type)
     {
       o << " Error: "
-        << (dwarf_diename_integrate (vardie) ?: "<anonymous>")
+        << (dwarf_diename (vardie) ?: "<anonymous>")
         << " isn't a struct/union";
       return;
     }
@@ -1573,14 +1573,14 @@ dwflpp::print_members(Dwarf_Die *vardie, ostream &o)
     {
     case 1:                            // No children.
       o << ((typetag == DW_TAG_union_type) ? " union " : " struct ")
-        << (dwarf_diename_integrate (die) ?: "<anonymous>")
+        << (dwarf_diename (die) ?: "<anonymous>")
         << " is empty";
       break;
 
     case -1:                           // Error.
     default:                           // Shouldn't happen.
       o << ((typetag == DW_TAG_union_type) ? " union " : " struct ")
-        << (dwarf_diename_integrate (die) ?: "<anonymous>")
+        << (dwarf_diename (die) ?: "<anonymous>")
         << ": " << dwarf_errmsg (-1);
       break;
 
@@ -1591,7 +1591,7 @@ dwflpp::print_members(Dwarf_Die *vardie, ostream &o)
   // Output each sibling's name to 'o'.
   while (dwarf_tag (die) == DW_TAG_member)
     {
-      const char *member = dwarf_diename_integrate (die) ;
+      const char *member = dwarf_diename (die) ;
 
       if ( member != NULL )
         o << " " << member;
@@ -1641,7 +1641,7 @@ dwflpp::find_struct_member(const target_symbol::component& c,
     case -1:           /* Error.  */
     default:           /* Shouldn't happen */
       throw semantic_error (string (dwarf_tag(&die) == DW_TAG_union_type ? "union" : "struct")
-                            + string (dwarf_diename_integrate (&die) ?: "<anonymous>")
+                            + string (dwarf_diename (&die) ?: "<anonymous>")
                             + string (dwarf_errmsg (-1)),
                             c.tok);
     }
@@ -1651,7 +1651,7 @@ dwflpp::find_struct_member(const target_symbol::component& c,
       if (dwarf_tag(&die) != DW_TAG_member)
         continue;
 
-      const char *name = dwarf_diename_integrate(&die);
+      const char *name = dwarf_diename(&die);
       if (name == NULL)
         {
           // need to recurse for anonymous structs/unions
@@ -1774,7 +1774,7 @@ dwflpp::translate_components(struct obstack *pool,
               Dwarf_Die *tmpdie = dwflpp::declaration_resolve(dwarf_diename(die));
               if (tmpdie == NULL)
                 throw semantic_error ("unresolved struct "
-                                      + string (dwarf_diename_integrate (die) ?: "<anonymous>"),
+                                      + string (dwarf_diename (die) ?: "<anonymous>"),
                                       c.tok);
               *die_mem = *tmpdie;
             }
@@ -1790,7 +1790,7 @@ dwflpp::translate_components(struct obstack *pool,
                     alternatives = " (alternatives:" + members.str();
                   throw semantic_error("unable to find member '" +
                                        c.member + "' for struct "
-                                       + string(dwarf_diename_integrate(die) ?: "<unknown>")
+                                       + string(dwarf_diename(die) ?: "<unknown>")
                                        + alternatives,
                                        c.tok);
                 }
@@ -1806,14 +1806,14 @@ dwflpp::translate_components(struct obstack *pool,
           throw semantic_error ("invalid access '"
                                 + lex_cast<string>(c)
                                 + "' vs. enum type "
-                                + string(dwarf_diename_integrate (die) ?: "<anonymous type>"),
+                                + string(dwarf_diename (die) ?: "<anonymous type>"),
                                 c.tok);
           break;
         case DW_TAG_base_type:
           throw semantic_error ("invalid access '"
                                 + lex_cast<string>(c)
                                 + "' vs. base type "
-                                + string(dwarf_diename_integrate (die) ?: "<anonymous type>"),
+                                + string(dwarf_diename (die) ?: "<anonymous type>"),
                                 c.tok);
           break;
         case -1:
@@ -1822,7 +1822,7 @@ dwflpp::translate_components(struct obstack *pool,
           break;
 
         default:
-          throw semantic_error (string(dwarf_diename_integrate (die) ?: "<anonymous type>")
+          throw semantic_error (string(dwarf_diename (die) ?: "<anonymous type>")
                                 + ": unexpected type tag "
                                 + lex_cast<string>(dwarf_tag (die)),
                                 c.tok);
index ccd9510c9b761de7bacdd39323fbe830b74e43aa..79cb3296642c7811ed0e4355ac5f50e892b78c93 100644 (file)
 
 #define _(msg) msg
 
-static const char *
-dwarf_diename_integrate (Dwarf_Die *die)
-{
-  Dwarf_Attribute attr_mem;
-  return dwarf_formstring (dwarf_attr_integrate (die, DW_AT_name, &attr_mem));
-}
-
-
 static void __attribute__ ((noreturn))
 fail (void *arg __attribute__ ((unused)), const char *fmt, ...)
 {
@@ -187,13 +179,13 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out,
            {
            case 1:             /* No children.  */
              error (2, 0, _("empty struct %s"),
-                    dwarf_diename_integrate (die) ?: "<anonymous>");
+                    dwarf_diename (die) ?: "<anonymous>");
              break;
            case -1:            /* Error.  */
            default:            /* Shouldn't happen */
              error (2, 0, _("%s %s: %s"),
                     typetag == DW_TAG_union_type ? "union" : "struct",
-                    dwarf_diename_integrate (die) ?: "<anonymous>",
+                    dwarf_diename (die) ?: "<anonymous>",
                     dwarf_errmsg (-1));
              break;
 
@@ -201,7 +193,7 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out,
              break;
            }
          while (dwarf_tag (die) != DW_TAG_member
-                || ({ const char *member = dwarf_diename_integrate (die);
+                || ({ const char *member = dwarf_diename (die);
                       member == NULL || strcmp (member, *fields); }))
            if (dwarf_siblingof (die, &die_mem) != 0)
              error (2, 0, _("field name %s not found"), *fields);
@@ -230,11 +222,11 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out,
                  if (dwarf_formsdata (&attr_mem, &off) != 0)
                    error (2, 0, _("Bad offset for %s %s: %s"),
                           typetag == DW_TAG_union_type ? "union" : "struct",
-                          dwarf_diename_integrate (die) ?: "<anonymous>",
+                          dwarf_diename (die) ?: "<anonymous>",
                           dwarf_errmsg (-1));
                    if (off != 0)
                      c_translate_add_offset (&pool, 1,
-                                             dwarf_diename_integrate (die)
+                                             dwarf_diename (die)
                                              ?: "", off, &tail);
                  break;
 
@@ -252,7 +244,7 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out,
 
        case DW_TAG_base_type:
          error (2, 0, _("field %s vs base type %s"),
-                *fields, dwarf_diename_integrate (die) ?: "<anonymous type>");
+                *fields, dwarf_diename (die) ?: "<anonymous type>");
          break;
 
        case -1:
@@ -261,7 +253,7 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out,
 
        default:
          error (2, 0, _("%s: unexpected type tag %#x"),
-                dwarf_diename_integrate (die) ?: "<anonymous type>",
+                dwarf_diename (die) ?: "<anonymous type>",
                 dwarf_tag (die));
          break;
        }
index f91d15d3cfc7e59632fc755b9f717b9b564ff408..8d0e0ab282596463760c98cfcd8955b2d3a8e221 100644 (file)
@@ -5607,7 +5607,7 @@ dwarf_type_name(Dwarf_Die& type_die, string& c_type)
     }
   if (done)
     {
-      c_type.append(dwarf_diename_integrate(&type_die));
+      c_type.append(dwarf_diename(&type_die));
       return true;
     }
 
@@ -5699,7 +5699,7 @@ tracepoint_derived_probe::build_args(dwflpp& dw, Dwarf_Die& func_die)
         {
           // build a tracepoint_arg for this parameter
           tracepoint_arg tparg;
-          tparg.name = dwarf_diename_integrate(&arg);
+          tparg.name = dwarf_diename(&arg);
 
           // read the type of this parameter
           Dwarf_Attribute type_attr;
This page took 0.04594 seconds and 5 git commands to generate.