make some changes to bonnie - now that the simulator uses more memory the old config...
[gem5.git] / cpu / exetrace.cc
index 4c5d148938dfcd6baa16094a3708831ec57a956e..048a7d283f7a2eecdb14b07f1f427ec80d6d9a91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2001-2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include <fstream>
 #include <iomanip>
 
-#include "dyn_inst.hh"
-#include "spec_state.hh"
-#include "issue.hh"
-#include "exetrace.hh"
-#include "exec_context.hh"
-#include "symtab.hh"
-#include "base_cpu.hh"
-#include "static_inst.hh"
+#include "sim/param.hh"
+#include "cpu/full_cpu/dyn_inst.hh"
+#include "cpu/full_cpu/spec_state.hh"
+#include "cpu/full_cpu/issue.hh"
+#include "cpu/exetrace.hh"
+#include "cpu/exec_context.hh"
+#include "base/loader/symtab.hh"
+#include "cpu/base_cpu.hh"
+#include "cpu/static_inst.hh"
 
 using namespace std;
 
@@ -47,11 +48,10 @@ using namespace std;
 //
 
 
-const SymbolTable *debugSymbolTable = NULL;
-
 void
 Trace::InstRecord::dump(ostream &outs)
 {
+
     if (flags[PRINT_CYCLE])
         ccprintf(outs, "%7d: ", cycle);
 
@@ -63,7 +63,18 @@ Trace::InstRecord::dump(ostream &outs)
     if (flags[PRINT_THREAD_NUM])
         outs << "T" << thread << " : ";
 
-    outs << "0x" << hex << PC << " : ";
+
+    std::string sym_str;
+    Addr sym_addr;
+    if (debugSymbolTable
+        && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)) {
+        if (PC != sym_addr)
+            sym_str += csprintf("+%d", PC - sym_addr);
+        outs << "@" << sym_str << " : ";
+    }
+    else {
+        outs << "0x" << hex << PC << " : ";
+    }
 
     //
     //  Print decoded instruction
@@ -73,11 +84,11 @@ Trace::InstRecord::dump(ostream &outs)
     // There's a bug in gcc 2.x library that prevents setw()
     // from working properly on strings
     string mc(staticInst->disassemble(PC, debugSymbolTable));
-    while (mc.length() < 25)
+    while (mc.length() < 26)
         mc += " ";
     outs << mc;
 #else
-    outs << setw(25) << staticInst->disassemble(PC, debugSymbolTable);
+    outs << setw(26) << left << staticInst->disassemble(PC, debugSymbolTable);
 #endif
 
     outs << " : ";
@@ -119,7 +130,6 @@ Trace::InstRecord::dump(ostream &outs)
     //  End of line...
     //
     outs << endl;
-    outs.flush();
 }
 
 
@@ -144,7 +154,7 @@ class ExecutionTraceParamContext : public ParamContext
 ExecutionTraceParamContext exeTraceParams("exetrace");
 
 Param<bool> exe_trace_spec(&exeTraceParams, "speculative",
-                           "capture speculative instructions", false);
+                           "capture speculative instructions", true);
 
 Param<bool> exe_trace_print_cycle(&exeTraceParams, "print_cycle",
                                   "print cycle number", true);