1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 52 unchanged lines hidden (view full) ---

61 0, 0, 0, 0, 0, 0, 0, 0};
62 static uint64_t ccr = 0;
63 static uint64_t y = 0;
64 static uint64_t floats[32];
65 uint64_t newVal;
66 static const char * prefixes[4] = {"G", "O", "L", "I"};
67 if (flags[PRINT_REG_DELTA])
68 {
69 ThreadContext * context = cpu->threadContexts[0];
69 char buf[256];
71 sprintf(buf, "PC = 0x%016llx", context->readNextPC());
70 sprintf(buf, "PC = 0x%016llx", thread->readNextPC());
71 outs << buf;
73 sprintf(buf, " NPC = 0x%016llx", context->readNextNPC());
72 sprintf(buf, " NPC = 0x%016llx", thread->readNextNPC());
73 outs << buf;
75 newVal = context->readMiscReg(SparcISA::MISCREG_CCR);
74 newVal = thread->readMiscReg(SparcISA::MISCREG_CCR);
75 if(newVal != ccr)
76 {
77 sprintf(buf, " CCR = 0x%016llx", newVal);
78 outs << buf;
79 ccr = newVal;
80 }
82 newVal = context->readMiscReg(SparcISA::MISCREG_Y);
81 newVal = thread->readMiscReg(SparcISA::MISCREG_Y);
82 if(newVal != y)
83 {
84 sprintf(buf, " Y = 0x%016llx", newVal);
85 outs << buf;
86 y = newVal;
87 }
88 for(int y = 0; y < 4; y++)
89 {
90 for(int x = 0; x < 8; x++)
91 {
92 int index = x + 8 * y;
94 newVal = context->readIntReg(index);
93 newVal = thread->readIntReg(index);
94 if(regs[index] != newVal)
95 {
96 sprintf(buf, " %s%d = 0x%016llx", prefixes[y], x, newVal);
97 outs << buf;
98 regs[index] = newVal;
99 }
100 }
101 }
102 for(int y = 0; y < 32; y++)
103 {
105 newVal = context->readFloatRegBits(2 * y, 64);
104 newVal = thread->readFloatRegBits(2 * y, 64);
105 if(floats[y] != newVal)
106 {
107 sprintf(buf, " F%d = 0x%016llx", y, newVal);
108 outs << buf;
109 floats[y] = newVal;
110 }
111 }
112 outs << endl;
114 /*
115 int numSources = staticInst->numSrcRegs();
116 int numDests = staticInst->numDestRegs();
117 outs << "Sources:";
118 for(int x = 0; x < numSources; x++)
119 {
120 int sourceNum = staticInst->srcRegIdx(x);
121 if(sourceNum < FP_Base_DepTag)
122 outs << " " << getIntRegName(sourceNum);
123 else if(sourceNum < Ctrl_Base_DepTag)
124 outs << " " << getFloatRegName(sourceNum - FP_Base_DepTag);
125 else
126 outs << " " << getMiscRegName(sourceNum - Ctrl_Base_DepTag);
127 }
128 outs << endl;
129 outs << "Destinations:";
130 for(int x = 0; x < numDests; x++)
131 {
132 int destNum = staticInst->destRegIdx(x);
133 if(destNum < FP_Base_DepTag)
134 outs << " " << getIntRegName(destNum);
135 else if(destNum < Ctrl_Base_DepTag)
136 outs << " " << getFloatRegName(destNum - FP_Base_DepTag);
137 else
138 outs << " " << getMiscRegName(destNum - Ctrl_Base_DepTag);
139 }
140 outs << endl;*/
113 }
114 else if (flags[INTEL_FORMAT]) {
115#if FULL_SYSTEM
144 bool is_trace_system = (cpu->system->name() == trace_system);
116 bool is_trace_system = (thread->getCpuPtr()->system->name() == trace_system);
117#else
118 bool is_trace_system = true;
119#endif
120 if (is_trace_system) {
121 ccprintf(outs, "%7d ) ", cycle);
122 outs << "0x" << hex << PC << ":\t";
123 if (staticInst->isLoad()) {
124 outs << "<RD 0x" << hex << addr;
125 outs << ">";
126 } else if (staticInst->isStore()) {
127 outs << "<WR 0x" << hex << addr;
128 outs << ">";
129 }
130 outs << endl;
131 }
132 } else {
133 if (flags[PRINT_CYCLE])
134 ccprintf(outs, "%7d: ", cycle);
135
164 outs << cpu->name() << " ";
136 outs << thread->getCpuPtr()->name() << " ";
137
138 if (flags[TRACE_MISSPEC])
139 outs << (misspeculating ? "-" : "+") << " ";
140
141 if (flags[PRINT_THREAD_NUM])
170 outs << "T" << thread << " : ";
142 outs << "T" << thread->getThreadNum() << " : ";
143
144
145 std::string sym_str;
146 Addr sym_addr;
147 if (debugSymbolTable
148 && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)
149 && flags[PC_SYMBOL]) {
150 if (PC != sym_addr)

--- 146 unchanged lines hidden ---