/*
- * Copyright (c) 2001-2004 The Regents of The University of Michigan
+ * Copyright (c) 2001-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __TRACE_HH__
-#define __TRACE_HH__
+#ifndef __BASE_TRACE_HH__
+#define __BASE_TRACE_HH__
#include <vector>
#include "base/cprintf.hh"
#include "base/match.hh"
#include "sim/host.hh"
-#include "sim/universe.hh"
+#include "sim/root.hh"
#ifndef TRACING_ON
#ifndef NDEBUG
extern const std::string DefaultName;
};
-inline const std::string &name() { return Trace::DefaultName; }
+// This silly little class allows us to wrap a string in a functor
+// object so that we can give a name() that DPRINTF will like
+struct StringWrap
+{
+ std::string str;
+ StringWrap(const std::string &s) : str(s) {}
+ const std::string &operator()() const { return str; }
+};
+inline const std::string &name() { return Trace::DefaultName; }
std::ostream &DebugOut();
//
#define DPRINTFR(x, args...) \
do { \
if (Trace::IsOn(Trace::x)) \
- __dprintf((Tick)-1, string(), args, cp::ArgListNull()); \
+ __dprintf((Tick)-1, std::string(), args, cp::ArgListNull()); \
} while (0)
#define DPRINTFN(args...) \
#endif // TRACING_ON
-#endif // __TRACE_HH__
+#endif // __BASE_TRACE_HH__