delete &args;
}
-
void
PrintfRecord::dump(ostream &os)
{
os.flush();
}
-
-
-RawDataRecord::RawDataRecord(Tick _cycle, const void *_data, int _len)
- : Record(_cycle), len(_len)
+DataRecord::DataRecord(Tick _cycle, const string &_name,
+ const void *_data, int _len)
+ : Record(_cycle), name(_name), len(_len)
{
data = new uint8_t[len];
memcpy(data, _data, len);
}
-
-RawDataRecord::~RawDataRecord()
+DataRecord::~DataRecord()
{
delete [] data;
}
-
void
-RawDataRecord::dump(ostream &os)
+DataRecord::dump(ostream &os)
{
int c, i, j;
for (i = 0; i < len; i += 16) {
- ccprintf(os, "%08x ", i);
+ ccprintf(os, "%d: %s: %08x ", cycle, name, i);
c = len - i;
if (c > 16) c = 16;
class Record
{
protected:
- Tick cycle;
+ Tick cycle;
Record(Tick _cycle)
: cycle(_cycle)
virtual void dump(std::ostream &);
};
- class RawDataRecord : public Record
+ class DataRecord : public Record
{
private:
+ const std::string &name;
uint8_t *data;
int len;
public:
- RawDataRecord(Tick cycle, const void *_data, int _len);
- virtual ~RawDataRecord();
+ DataRecord(Tick cycle, const std::string &name,
+ const void *_data, int _len);
+ virtual ~DataRecord();
virtual void dump(std::ostream &);
};
}
inline void
- rawDump(const void *data, int len)
+ dataDump(Tick cycle, const std::string &name, const void *data, int len)
{
- theLog.append(new Trace::RawDataRecord(curTick, data, len));
+ theLog.append(new Trace::DataRecord(cycle, name, data, len));
}
extern const std::string DefaultName;
#define DDUMP(x, data, count) \
do { \
if (Trace::IsOn(Trace::x)) \
- Trace::rawDump(data, count); \
+ Trace::dataDump(curTick, name(), data, count); \
} while (0)
#define __dprintf(cycle, name, format, args...) \
#include "base/cprintf.hh"
#include "base/trace.hh"
+#include "cpu/exec_context.hh"
#include "kern/tru64/mbuf.hh"
#include "sim/host.hh"
#include "targetarch/arguments.hh"
addr, m.m_data, m.m_len);
char *buffer = new char[m.m_len];
CopyOut(xc, buffer, m.m_data, m.m_len);
- Trace::rawDump((uint8_t *)buffer, m.m_len);
+ Trace::dataDump(curTick, xc->system->name(), (uint8_t *)buffer,
+ m.m_len);
delete [] buffer;
count -= m.m_len;