]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Expose the underlying string in pri:: family of formatting functions
authorPetr Machata <pmachata@redhat.com>
Thu, 26 Nov 2009 18:20:23 +0000 (19:20 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:14 +0000 (14:55 +0200)
src/dwarflint/check_debug_info.cc
src/dwarflint/pri.hh

index db76d67dd09f0608730888b5d6053c2df4594dfa..46433cdf9c7b03427661715b9e22ccfadc68c066 100644 (file)
@@ -645,6 +645,7 @@ namespace
                {
                case DW_FORM_data8:
                  if (cu->head->offset_size == 4)
+                   // xxx could now also be checked during abbrev loading
                    wr_error (where)
                      << pri::attr (it->name)
                      << " with form DW_FORM_data8 in 32-bit CU." << std::endl;
@@ -871,13 +872,9 @@ namespace
                    && (relocate == rel_require
                        || (relocate == rel_nonzero
                            && value != 0)))
-                 {
-                   std::stringstream ss;
-                   ss << pri::form (form);
-                   wr_message (where, cat (mc_impact_2, mc_die_other,
-                                           mc_reloc, extra_mc))
-                     << pri::lacks_relocation (ss.str ()) << std::endl;
-                 }
+                 wr_message (where, cat (mc_impact_2, mc_die_other,
+                                         mc_reloc, extra_mc))
+                   << pri::lacks_relocation (pri::form (form)) << std::endl;
              }
 
            /* Dispatch value checking.  */
index ccdbb1ec47206b7318b350e80e980aab80975e6e..54d47ebfa6274ae4326c26cf3798a0eb73a7372a 100644 (file)
@@ -17,6 +17,9 @@ namespace pri
       : m_s (a + b + c)
     {}
     friend std::ostream &operator << (std::ostream &os, pribase const &obj);
+
+  public:
+    operator std::string const &() const { return m_s; }
   };
   std::ostream &operator << (std::ostream &os, pribase const &obj);