style: cleanup the Ruby Tester
[gem5.git] / src / cpu / exetrace.cc
index 4c0f83a217effadc1725d29d4aa3703e622f008d..07be700bbd309fd406a1df5373b18086f3e53f68 100644 (file)
@@ -38,6 +38,7 @@
 #include "cpu/exetrace.hh"
 #include "cpu/static_inst.hh"
 #include "cpu/thread_context.hh"
+#include "config/the_isa.hh"
 #include "enums/OpClass.hh"
 
 using namespace std;
@@ -45,13 +46,19 @@ using namespace TheISA;
 
 namespace Trace {
 
+void
+ExeTracerRecord::dumpTicks(ostream &outs)
+{
+    ccprintf(outs, "%7d: ", when);
+}
+
 void
 Trace::ExeTracerRecord::traceInst(StaticInstPtr inst, bool ran)
 {
     ostream &outs = Trace::output();
 
     if (IsOn(ExecTicks))
-        ccprintf(outs, "%7d: ", when);
+        dumpTicks(outs);
 
     outs << thread->getCpuPtr()->name() << " ";
 
@@ -65,6 +72,9 @@ Trace::ExeTracerRecord::traceInst(StaticInstPtr inst, bool ran)
     Addr sym_addr;
     if (debugSymbolTable
         && IsOn(ExecSymbol)
+#if FULL_SYSTEM
+        && !inUserMode(thread)
+#endif
         && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)) {
         if (PC != sym_addr)
             sym_str += csprintf("+%d", PC - sym_addr);
@@ -128,10 +138,10 @@ Trace::ExeTracerRecord::dump()
      * complete/print when they fault.
      */
     if (IsOn(ExecMacro) && staticInst->isMicroop() &&
-            (IsOn(ExecMicro) &&
+            ((IsOn(ExecMicro) &&
              macroStaticInst && staticInst->isFirstMicroop()) ||
             (!IsOn(ExecMicro) &&
-             macroStaticInst && staticInst->isLastMicroop())) {
+             macroStaticInst && staticInst->isLastMicroop()))) {
         traceInst(macroStaticInst, false);
     }
     if (IsOn(ExecMicro) || !staticInst->isMicroop()) {