[llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu May 20 12:03:02 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

RuntimeOptimizations.cpp updated: 1.35 -> 1.36

---
Log message:

Add a hook which is easy to set a breakpoint on for debugging purposes.
For extra bonus points, it even prints out gdb breakpoint commands you'll want
to use.


---
Diffs of the changes:  (+7 -0)

Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.35 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.36
--- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.35	Wed May 19 15:16:11 2004
+++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp	Thu May 20 12:00:45 2004
@@ -70,6 +70,12 @@
 
 extern void WriteTraceToFile (Trace &T);
 
+extern "C" void TraceOptimizerDone (uint64_t a, uint64_t traceStartAddr) {
+  std::cerr << "\n*** About to return from optimizeTrace(). GDB breakpoints:\n"
+    << std::hex << "display/i $pc\n" << "b *0x" << a << "\n" << "b *0x"
+    << traceStartAddr << std::dec << "\n";
+}
+
 /// This method is called when we have finally constructed a
 /// trace. The first parameter is the vector of basic blocks that form
 /// the trace; the second parameter is the starting
@@ -132,6 +138,7 @@
                   << " to point to 0x" << traceStartAddr << std::dec << "\n");
   vm->writeBranchInstruction(a, traceStartAddr);
   doFlush (a, a + 4);
+  TraceOptimizerDone(a, traceStartAddr);
 }
 
 } // end namespace llvm





More information about the llvm-commits mailing list