]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Share print-die compilation among tests.
authorRoland McGrath <roland@redhat.com>
Wed, 26 Aug 2009 06:48:41 +0000 (23:48 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 26 Aug 2009 06:48:41 +0000 (23:48 -0700)
libdw/c++/subr.hh
tests/ChangeLog
tests/Makefile.am
tests/dwarf-print.cc
tests/print-die.cc [moved from tests/print-die.hh with 96% similarity]

index 77244658736e57e8a7fd89d8b468a1930a87047e..5d4df089ea07c1a763044424b6354978b526275c 100644 (file)
@@ -674,18 +674,22 @@ namespace elfutils
        _base::operator++ ();
        return *this;
       }
-      inline wrapped_input_iterator operator++ (int magic) // postfix
+      inline wrapped_input_iterator operator++ (int) // postfix
       {
-       return wrapped_input_iterator (_base::operator++ (magic));
+       wrapped_input_iterator pre = *this;
+       ++*this;
+       return pre;
       }
       inline wrapped_input_iterator &operator-- () // prefix
       {
        _base::operator-- ();
        return *this;
       }
-      inline wrapped_input_iterator operator-- (int magic) // postfix
+      inline wrapped_input_iterator operator-- (int) // postfix
       {
-       return wrapped_input_iterator (_base::operator-- (magic));
+       wrapped_input_iterator pre = *this;
+       --*this;
+       return pre;
       }
 
       inline const _base &base () const
index 3a81522a78a57ee9b2b6a4af645d845411a65a73..8f7e9dc22ed5ee134150e81bed6c93904eb96e3a 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-25  Roland McGrath  <roland@redhat.com>
+
+       * print-die.hh: New file with extern decls.  Contents moved to ...
+       * print-die.cc: ... here, new file.
+       * Makefile.am (dwarf_print_SOURCES, dwarf_edit_SOURCES): Build it.
+
 2009-08-21  Roland McGrath  <roland@redhat.com>
 
        * print-die.hh (print_die_main, print_file): Add --silent option.
index b0da862c04da6f0e20c3872bfecf7b39f6196967..ad5a466d3ce09a1ac620b8c5da51c1e5dc7e2374 100644 (file)
@@ -195,10 +195,10 @@ endif !STANDALONE
 # XXX later the C++ stuff will be in libdw.so directly
 libdwpp = ../libdw/libdwpp.a $(libdw)
 
-dwarf_print_SOURCES = dwarf-print.cc
+dwarf_print_SOURCES = dwarf-print.cc print-die.cc
 dwarf_print_LDADD = $(libdwpp) $(libmudflap) -ldl
 
-dwarf_edit_SOURCES = dwarf_edit.cc
+dwarf_edit_SOURCES = dwarf_edit.cc print-die.cc
 dwarf_edit_LDADD = $(libdwpp) $(libmudflap) -ldl
 
 arextract_LDADD = $(libelf) $(libmudflap)
index 36b9415beed324ea15793e6faf203f2328797fe7..698dd0dab9f2238ef61b251d18f24631610c3d4b 100644 (file)
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <error.h>
 #include <fcntl.h>
+#include <libintl.h>
 
 #include "c++/dwarf"
 
similarity index 96%
rename from tests/print-die.hh
rename to tests/print-die.cc
index 76f160b4453d40af5a022e6caa6858b88ec51adf..728eb74aee988df639cfce69f0f085f709496511 100644 (file)
    Network licensing program, please visit www.openinventionnetwork.com
    <http://www.openinventionnetwork.com>.  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include <cstring>
 #include <cstdio>
 #include <cstdlib>
@@ -37,6 +41,9 @@
 #include "c++/dwarf_edit"
 #include "c++/dwarf_output"
 
+using namespace elfutils;
+using namespace std;
+
 static bool print_offset;
 static bool sort_attrs;
 static bool elide_refs;
@@ -45,7 +52,7 @@ static bool no_print;
 
 static enum { copy_none, copy_edit, copy_output } make_copy;
 
-static void
+void
 print_die_main (int &argc, char **&argv, unsigned int &depth)
 {
   /* Set locale.  */
@@ -291,7 +298,7 @@ print_file (const file &dw, const unsigned int limit)
 }
 
 template<typename file>
-static void
+void
 print_file (const char *name, const file &dw, const unsigned int limit)
 {
   cout << name << ":\n";
@@ -314,3 +321,9 @@ print_file (const char *name, const file &dw, const unsigned int limit)
       abort ();
     }
 }
+
+// Explicit instantiations.
+template void print_file (const char *, const dwarf &,
+                         const unsigned int);
+template void print_file (const char *, const dwarf_edit &,
+                         const unsigned int);