summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdw/c++/subr.hh12
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/dwarf-print.cc1
-rw-r--r--tests/print-die.cc (renamed from tests/print-die.hh)17
5 files changed, 32 insertions, 8 deletions
diff --git a/libdw/c++/subr.hh b/libdw/c++/subr.hh
index 77244658..5d4df089 100644
--- a/libdw/c++/subr.hh
+++ b/libdw/c++/subr.hh
@@ -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
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3a81522a..8f7e9dc2 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-25 Roland McGrath <[email protected]>
+
+ * 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 <[email protected]>
* print-die.hh (print_die_main, print_file): Add --silent option.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b0da862c..ad5a466d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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)
diff --git a/tests/dwarf-print.cc b/tests/dwarf-print.cc
index 36b9415b..698dd0da 100644
--- a/tests/dwarf-print.cc
+++ b/tests/dwarf-print.cc
@@ -30,6 +30,7 @@
#include <errno.h>
#include <error.h>
#include <fcntl.h>
+#include <libintl.h>
#include "c++/dwarf"
diff --git a/tests/print-die.hh b/tests/print-die.cc
index 76f160b4..728eb74a 100644
--- a/tests/print-die.hh
+++ b/tests/print-die.cc
@@ -23,6 +23,10 @@
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);