summaryrefslogtreecommitdiff
path: root/src/base/trace.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-02-07 22:11:30 -0800
committerNathan Binkert <binkertn@umich.edu>2007-02-07 22:11:30 -0800
commit1f834b569c8a39f44882c2f2010a9f0ecffdaab1 (patch)
tree5d4ea11cf603704442e9216c1ab22e9f3e0c297e /src/base/trace.cc
parentaf698e8b0506b17dfa9eb6d1e96888cf54041a09 (diff)
downloadgem5-1f834b569c8a39f44882c2f2010a9f0ecffdaab1.tar.xz
Get rid of the gross operator,()/variadic macro hack
that made ccprintf and friends work, turn it into a normal function (though it still has a slightly strange implementation.) All instances of variadic macros are not yet removed, but I know how, and it will happen. One side effect of this new implementation is that a cprintf statement can now only have 16 parameters, though it's easy enough to raise this number if needed. --HG-- extra : convert_revision : 85cb3c17f8e2ecf9cd2f31ea80a760a28ea127a7
Diffstat (limited to 'src/base/trace.cc')
-rw-r--r--src/base/trace.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/base/trace.cc b/src/base/trace.cc
index 9fa615f4d..6e9838456 100644
--- a/src/base/trace.cc
+++ b/src/base/trace.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2005 The Regents of The University of Michigan
+ * Copyright (c) 2001-2006 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@
#include "base/misc.hh"
#include "base/trace.hh"
#include "base/str.hh"
+#include "base/varargs.hh"
using namespace std;
@@ -153,9 +154,7 @@ Log::dump(ostream &os)
}
PrintfRecord::~PrintfRecord()
-{
- delete &args;
-}
+{}
void
PrintfRecord::dump(ostream &os)
@@ -164,17 +163,17 @@ PrintfRecord::dump(ostream &os)
if (!name.empty()) {
fmt = "%s: " + fmt;
- args.prepend(name);
+ args.push_front(name);
}
if (cycle != (Tick)-1) {
fmt = "%7d: " + fmt;
- args.prepend(cycle);
+ args.push_front(cycle);
}
fmt += format;
- args.dump(os, fmt);
+ ccprintf(os, fmt.c_str(), args);
os.flush();
}