exetrace.cc (3065:9bcb404a4a5b) | exetrace.cc (3380:382e21bc32f3) |
---|---|
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; --- 46 unchanged lines hidden (view full) --- 55 56 57void 58Trace::InstRecord::dump(ostream &outs) 59{ 60 if (flags[PRINT_REG_DELTA]) 61 { 62#if THE_ISA == SPARC_ISA | 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; --- 46 unchanged lines hidden (view full) --- 55 56 57void 58Trace::InstRecord::dump(ostream &outs) 59{ 60 if (flags[PRINT_REG_DELTA]) 61 { 62#if THE_ISA == SPARC_ISA |
63 static uint64_t regs[32] = { 64 0, 0, 0, 0, 0, 0, 0, 0, 65 0, 0, 0, 0, 0, 0, 0, 0, 66 0, 0, 0, 0, 0, 0, 0, 0, 67 0, 0, 0, 0, 0, 0, 0, 0}; 68 static uint64_t ccr = 0; 69 static uint64_t y = 0; 70 static uint64_t floats[32]; 71 uint64_t newVal; 72 static const char * prefixes[4] = {"G", "O", "L", "I"}; 73 74 char buf[256]; 75 sprintf(buf, "PC = 0x%016llx", thread->readNextPC()); 76 outs << buf; 77 sprintf(buf, " NPC = 0x%016llx", thread->readNextNPC()); 78 outs << buf; 79 newVal = thread->readMiscReg(SparcISA::MISCREG_CCR); 80 if(newVal != ccr) | 63 //Don't print what happens for each micro-op, just print out 64 //once at the last op, and for regular instructions. 65 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp()) |
81 { | 66 { |
82 sprintf(buf, " CCR = 0x%016llx", newVal); | 67 static uint64_t regs[32] = { 68 0, 0, 0, 0, 0, 0, 0, 0, 69 0, 0, 0, 0, 0, 0, 0, 0, 70 0, 0, 0, 0, 0, 0, 0, 0, 71 0, 0, 0, 0, 0, 0, 0, 0}; 72 static uint64_t ccr = 0; 73 static uint64_t y = 0; 74 static uint64_t floats[32]; 75 uint64_t newVal; 76 static const char * prefixes[4] = {"G", "O", "L", "I"}; 77 78 char buf[256]; 79 sprintf(buf, "PC = 0x%016llx", thread->readNextPC()); |
83 outs << buf; | 80 outs << buf; |
84 ccr = newVal; 85 } 86 newVal = thread->readMiscReg(SparcISA::MISCREG_Y); 87 if(newVal != y) 88 { 89 sprintf(buf, " Y = 0x%016llx", newVal); | 81 sprintf(buf, " NPC = 0x%016llx", thread->readNextNPC()); |
90 outs << buf; | 82 outs << buf; |
91 y = newVal; 92 } 93 for(int y = 0; y < 4; y++) 94 { 95 for(int x = 0; x < 8; x++) | 83 newVal = thread->readMiscReg(SparcISA::MISCREG_CCR); 84 if(newVal != ccr) |
96 { | 85 { |
97 int index = x + 8 * y; 98 newVal = thread->readIntReg(index); 99 if(regs[index] != newVal) | 86 sprintf(buf, " CCR = 0x%016llx", newVal); 87 outs << buf; 88 ccr = newVal; 89 } 90 newVal = thread->readMiscReg(SparcISA::MISCREG_Y); 91 if(newVal != y) 92 { 93 sprintf(buf, " Y = 0x%016llx", newVal); 94 outs << buf; 95 y = newVal; 96 } 97 for(int y = 0; y < 4; y++) 98 { 99 for(int x = 0; x < 8; x++) |
100 { | 100 { |
101 sprintf(buf, " %s%d = 0x%016llx", prefixes[y], x, newVal); 102 outs << buf; 103 regs[index] = newVal; | 101 int index = x + 8 * y; 102 newVal = thread->readIntReg(index); 103 if(regs[index] != newVal) 104 { 105 sprintf(buf, " %s%d = 0x%016llx", prefixes[y], x, newVal); 106 outs << buf; 107 regs[index] = newVal; 108 } |
104 } 105 } | 109 } 110 } |
106 } 107 for(int y = 0; y < 32; y++) 108 { 109 newVal = thread->readFloatRegBits(2 * y, 64); 110 if(floats[y] != newVal) | 111 for(int y = 0; y < 32; y++) |
111 { | 112 { |
112 sprintf(buf, " F%d = 0x%016llx", y, newVal); 113 outs << buf; 114 floats[y] = newVal; | 113 newVal = thread->readFloatRegBits(2 * y, 64); 114 if(floats[y] != newVal) 115 { 116 sprintf(buf, " F%d = 0x%016llx", 2 * y, newVal); 117 outs << buf; 118 floats[y] = newVal; 119 } |
115 } | 120 } |
121 outs << endl; |
|
116 } | 122 } |
117 outs << endl; | |
118#endif 119 } 120 else if (flags[INTEL_FORMAT]) { 121#if FULL_SYSTEM 122 bool is_trace_system = (thread->getCpuPtr()->system->name() == trace_system); 123#else 124 bool is_trace_system = true; 125#endif --- 177 unchanged lines hidden --- | 123#endif 124 } 125 else if (flags[INTEL_FORMAT]) { 126#if FULL_SYSTEM 127 bool is_trace_system = (thread->getCpuPtr()->system->name() == trace_system); 128#else 129 bool is_trace_system = true; 130#endif --- 177 unchanged lines hidden --- |