]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Drop pri::tag, pri::attr
authorPetr Machata <pmachata@redhat.com>
Fri, 25 Feb 2011 14:19:54 +0000 (15:19 +0100)
committerPetr Machata <pmachata@redhat.com>
Fri, 25 Feb 2011 14:19:54 +0000 (15:19 +0100)
- dwarf::tags::name, dwarf::attributes::name should be used instead

dwarflint/check_debug_info.cc
dwarflint/check_expected_trees.cc
dwarflint/check_range_out_of_scope.cc
dwarflint/dwarf_version.cc
dwarflint/locstats.cc
dwarflint/pri.cc
dwarflint/pri.hh

index 69d8fdd3ed2fb2f6143db597d7f54f7c1290d5f4..b46c7a15eff96e37ece9a3538c2553e5a9492eee 100644 (file)
@@ -31,6 +31,7 @@
 #include <cassert>
 #include <algorithm>
 #include "../libdw/dwarf.h"
+#include "../libdw/c++/dwarf"
 
 #include "messages.hh"
 #include "dwarf_version.hh"
@@ -785,7 +786,8 @@ namespace
                // error the second time now.
                wr_error (where)
                  << "can't read value of attribute "
-                 << pri::attr (it->name) << '.' << std::endl;
+                 << elfutils::dwarf::attributes::name (it->name)
+                 << '.' << std::endl;
                return -1;
              }
            if (storclass == sc_block)
index 955cf8d17925f0f04c032e0ea0446db8157a7d68..63b44752a04353d8367813a2b626e10ba3c22de6 100644 (file)
@@ -32,7 +32,6 @@
 #include "expected.hh"
 #include "../src/dwarfstrings.h"
 #include "../libdw/c++/dwarf-knowledge.cc"
-#include "pri.hh"
 #include "messages.hh"
 
 using elfutils::dwarf;
@@ -127,19 +126,22 @@ check_expected_trees::check_expected_trees (checkstack &stack, dwarflint &lint)
                 = expect.begin (); jt != expect.end (); ++jt)
            {
              std::set <int>::iterator kt = attributes.find (jt->first);
+             char const *what = NULL;
              if (kt == attributes.end ())
                switch (jt->second)
                  {
                  case opt_required:
-                   wr_message (where, cat (mc_impact_4, mc_info))
-                     << pri::tag (parent_tag) << " lacks required attribute "
-                     << pri::attr (jt->first) << '.' << std::endl;
-                   break;
+                   what = " lacks required attribute ";
+                   // FALL_THROUGH
 
                  case opt_expected:
+                   if (what == NULL)
+                     what = " should contain attribute ";
                    wr_message (where, cat (mc_impact_2, mc_info))
-                     << pri::tag (parent_tag) << " should contain attribute "
-                     << pri::attr (jt->first) << '.' << std::endl;
+                     << elfutils::dwarf::tags::name (parent_tag) << what
+                     << elfutils::dwarf::attributes::name (jt->first) << '.'
+                     << std::endl;
+                   break;
 
                  case opt_optional:
                    break;
index 0495d40512de13f57c05f6d4729bb1e44948e7b6..05d914a9a7ae29875257f804fcee82904d647dee 100644 (file)
@@ -1,5 +1,5 @@
 /* Check whether PC ranges reported at DIE fall into the containing scope.
-   Copyright (C) 2009,2010 Red Hat, Inc.
+   Copyright (C) 2009,2010,2011 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -224,7 +224,8 @@ check_range_out_of_scope::recursively_validate
                    {
                      runoff = true;
                      wr_error (wh)
-                       << "attribute `" << pri::attr ((*at).first)
+                       << "attribute `"
+                       << elfutils::dwarf::attributes::name ((*at).first)
                        << "': PC range " << pri::range (start, end)
                        << " outside containing scope." << std::endl;
                    }
index 819f8106b0833b6203a6d0440b5dd3d17f834028..10bfcbd2893ad934915f257181f1ba11fa85d9d4 100644 (file)
@@ -39,6 +39,7 @@
 #include "dwarf_mips.hh"
 #include "check_debug_info.hh"
 #include "pri.hh"
+#include "c++/dwarf"
 
 #include "../libdw/dwarf.h"
 #include <map>
@@ -139,7 +140,7 @@ attribute::attribute (int a_name, dw_class_set const &a_classes)
 std::ostream &
 operator << (std::ostream &os, attribute const &obj)
 {
-  return os << pri::attr (obj.name ());
+  return os << elfutils::dwarf::attributes::name (obj.name ());
 }
 
 
index 7f7571d29a634774709d77505a1168ed758dad5b..7ef2423e5be3bec09e29fe97e776100125d1c991 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2010 Red Hat, Inc.
+   Copyright (C) 2010, 2011 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -572,7 +572,7 @@ locstats::locstats (checkstack &stack, dwarflint &lint)
            {
              auto const &d = *sit;
              std::cerr << pad << pri::ref (d) << " "
-                       << pri::tag (d.tag ()) << std::endl;
+                       << elfutils::dwarf::tags::name (d.tag ()) << std::endl;
              for (auto atit = d.attributes ().begin ();
                   atit != d.attributes ().end (); ++atit)
                {
index 09e30257afed42fd332b1970f66a3136c86f2e72..3c20bc0949dbdd77dddf9630c6ebd5862253772c 100644 (file)
@@ -38,18 +38,10 @@ pri::operator << (std::ostream &os, pri::pribase const &obj)
   return os << obj.m_s;
 }
 
-pri::attr::attr (int attr_name)
-  : pribase (elfutils::dwarf::attributes::name (attr_name))
-{}
-
 pri::form::form (int attr_form)
   : pribase (dwarf_form_string (attr_form))
 {}
 
-pri::tag::tag (int die_tag)
-  : pribase (elfutils::dwarf::tags::name (die_tag))
-{}
-
 pri::locexpr_opcode::locexpr_opcode (int opcode)
   : pribase (dwarf_locexpr_opcode_string (opcode))
 {}
index b9806dfa1d4918ca38459fff30cb643935695d61..c5c6f6afd44e90bc15d69d1918ddaf88b776ebfc 100644 (file)
@@ -1,5 +1,5 @@
 /* Pedantic checking of DWARF files
-   Copyright (C) 2009,2010 Red Hat, Inc.
+   Copyright (C) 2009,2010,2011 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -66,24 +66,12 @@ namespace pri
     {}
   };
 
-  struct attr
-    : public pribase
-  {
-    attr (int attr_name);
-  };
-
   struct form
     : public pribase
   {
     form (int attr_form);
   };
 
-  struct tag
-    : public pribase
-  {
-    tag (int tag);
-  };
-
   struct locexpr_opcode
     : public pribase
   {