diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-08-30 19:08:24 -0400 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-08-30 19:08:24 -0400 |
commit | fa0fca32273444fb2451397c255b0a8e0763147a (patch) | |
tree | c95820ab573d095545354a76a0c7eb8a80052c26 /src/cpu/exetrace.cc | |
parent | 05177abbc98e98122a706fdb1498496524b58e34 (diff) | |
download | gem5-fa0fca32273444fb2451397c255b0a8e0763147a.tar.xz |
Change the cpu pointer in the InstRecord object to a thread context pointer.
--HG--
extra : convert_revision : 7efb2680cef4219281b94d680a4a7c75c123f89d
Diffstat (limited to 'src/cpu/exetrace.cc')
-rw-r--r-- | src/cpu/exetrace.cc | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/src/cpu/exetrace.cc b/src/cpu/exetrace.cc index 0008035c2..ad802eba2 100644 --- a/src/cpu/exetrace.cc +++ b/src/cpu/exetrace.cc @@ -66,20 +66,19 @@ Trace::InstRecord::dump(ostream &outs) static const char * prefixes[4] = {"G", "O", "L", "I"}; if (flags[PRINT_REG_DELTA]) { - ThreadContext * context = cpu->threadContexts[0]; char buf[256]; - sprintf(buf, "PC = 0x%016llx", context->readNextPC()); + sprintf(buf, "PC = 0x%016llx", thread->readNextPC()); outs << buf; - sprintf(buf, " NPC = 0x%016llx", context->readNextNPC()); + sprintf(buf, " NPC = 0x%016llx", thread->readNextNPC()); outs << buf; - newVal = context->readMiscReg(SparcISA::MISCREG_CCR); + newVal = thread->readMiscReg(SparcISA::MISCREG_CCR); if(newVal != ccr) { sprintf(buf, " CCR = 0x%016llx", newVal); outs << buf; ccr = newVal; } - newVal = context->readMiscReg(SparcISA::MISCREG_Y); + newVal = thread->readMiscReg(SparcISA::MISCREG_Y); if(newVal != y) { sprintf(buf, " Y = 0x%016llx", newVal); @@ -91,7 +90,7 @@ Trace::InstRecord::dump(ostream &outs) for(int x = 0; x < 8; x++) { int index = x + 8 * y; - newVal = context->readIntReg(index); + newVal = thread->readIntReg(index); if(regs[index] != newVal) { sprintf(buf, " %s%d = 0x%016llx", prefixes[y], x, newVal); @@ -102,7 +101,7 @@ Trace::InstRecord::dump(ostream &outs) } for(int y = 0; y < 32; y++) { - newVal = context->readFloatRegBits(2 * y, 64); + newVal = thread->readFloatRegBits(2 * y, 64); if(floats[y] != newVal) { sprintf(buf, " F%d = 0x%016llx", y, newVal); @@ -111,37 +110,10 @@ Trace::InstRecord::dump(ostream &outs) } } outs << endl; - /* - int numSources = staticInst->numSrcRegs(); - int numDests = staticInst->numDestRegs(); - outs << "Sources:"; - for(int x = 0; x < numSources; x++) - { - int sourceNum = staticInst->srcRegIdx(x); - if(sourceNum < FP_Base_DepTag) - outs << " " << getIntRegName(sourceNum); - else if(sourceNum < Ctrl_Base_DepTag) - outs << " " << getFloatRegName(sourceNum - FP_Base_DepTag); - else - outs << " " << getMiscRegName(sourceNum - Ctrl_Base_DepTag); - } - outs << endl; - outs << "Destinations:"; - for(int x = 0; x < numDests; x++) - { - int destNum = staticInst->destRegIdx(x); - if(destNum < FP_Base_DepTag) - outs << " " << getIntRegName(destNum); - else if(destNum < Ctrl_Base_DepTag) - outs << " " << getFloatRegName(destNum - FP_Base_DepTag); - else - outs << " " << getMiscRegName(destNum - Ctrl_Base_DepTag); - } - outs << endl;*/ } else if (flags[INTEL_FORMAT]) { #if FULL_SYSTEM - bool is_trace_system = (cpu->system->name() == trace_system); + bool is_trace_system = (thread->getCpuPtr()->system->name() == trace_system); #else bool is_trace_system = true; #endif @@ -161,13 +133,13 @@ Trace::InstRecord::dump(ostream &outs) if (flags[PRINT_CYCLE]) ccprintf(outs, "%7d: ", cycle); - outs << cpu->name() << " "; + outs << thread->getCpuPtr()->name() << " "; if (flags[TRACE_MISSPEC]) outs << (misspeculating ? "-" : "+") << " "; if (flags[PRINT_THREAD_NUM]) - outs << "T" << thread << " : "; + outs << "T" << thread->getThreadNum() << " : "; std::string sym_str; |