debug: create a Debug namespace
authorNathan Binkert <nate@binkert.org>
Fri, 15 Apr 2011 17:44:15 +0000 (10:44 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 15 Apr 2011 17:44:15 +0000 (10:44 -0700)
src/arch/alpha/ev5.cc
src/base/debug.cc
src/base/debug.hh
src/base/statistics.cc
src/cpu/pc_event.cc
src/dev/ns_gige.cc
src/dev/sinic.cc
src/sim/debug.cc
src/sim/pseudo_inst.cc

index f97244260518c82e52d5e34eda2e1672ddba5bdc..2bc913f92e0b1ef4045968788d1fedec6964aa85 100644 (file)
@@ -289,7 +289,7 @@ ISA::setIpr(int idx, uint64_t val, ThreadContext *tc)
       case IPR_IPLR:
 #ifdef DEBUG
         if (break_ipl != -1 && break_ipl == (int)(val & 0x1f))
-            debug_break();
+            Debug::breakpoint();
 #endif
 
         // only write least significant five bits - interrupt level
index 1d7be5a9a5baf9530acf3ade1d455e6e41f60103..6f01b3fc026021576261bbe1c2b0253ad0d53697 100644 (file)
 
 #include "base/cprintf.hh"
 
+namespace Debug {
+
 void
-debug_break()
+breakpoint()
 {
 #ifndef NDEBUG
     kill(getpid(), SIGTRAP);
 #else
-    cprintf("debug_break suppressed, compiled with NDEBUG\n");
+    cprintf("Debug::breakpoint suppressed, compiled with NDEBUG\n");
 #endif
 }
+
+} // namespace Debug
index b1577f782b1e47a7828b8e39f628afcd6b362c28..ee7402912cf2e35828dc00094d5da717edad9ee5 100644 (file)
 #ifndef __BASE_DEBUG_HH__
 #define __BASE_DEBUG_HH__
 
-void debug_break();
+namespace Debug {
+
+void breakpoint();
+
+} // namespace Debug
 
 #endif // __BASE_DEBUG_HH__
index 5ee018b1c3910b08cba9347fe3c36aa577f407dc..fa3a4a0c94d1493e547ee7c58432694dfc4af127 100644 (file)
@@ -130,7 +130,7 @@ Info::Info()
 {
     id = id_count++;
     if (debug_break_id >= 0 and debug_break_id == id)
-        debug_break();
+        Debug::breakpoint();
 }
 
 Info::~Info()
index 40432ed93a2d0330924c7f34e66b580ee39b7e2a..0ac5102bb7ec995430eb864bf97da68ac06468ea 100644 (file)
@@ -132,7 +132,7 @@ BreakPCEvent::process(ThreadContext *tc)
 {
     StringWrap name(tc->getCpuPtr()->name() + ".break_event");
     DPRINTFN("break event %s triggered\n", descr());
-    debug_break();
+    Debug::breakpoint();
     if (remove)
         delete this;
 }
index 794fd53551b89a2bbda8600a59dfa55c1efecee2..f1b95e113623c1ac4d76d6825614c741ea2c9bd4 100644 (file)
@@ -937,7 +937,7 @@ NSGigE::cpuIntrPost(Tick when)
 
     intrTick = when;
     if (intrTick < curTick()) {
-        debug_break();
+        Debug::breakpoint();
         intrTick = curTick();
     }
 
@@ -1705,7 +1705,7 @@ NSGigE::txKick()
                             udp->sum(cksum(udp));
                             txUdpChecksums++;
                         } else {
-                            debug_break();
+                            Debug::breakpoint();
                             warn_once("UDPPKT set, but not UDP!\n");
                         }
                     } else if (extsts & EXTSTS_TCPPKT) {
@@ -1715,7 +1715,7 @@ NSGigE::txKick()
                             tcp->sum(cksum(tcp));
                             txTcpChecksums++;
                         } else {
-                            debug_break();
+                            Debug::breakpoint();
                             warn_once("TCPPKT set, but not UDP!\n");
                         }
                     }
@@ -1725,7 +1725,7 @@ NSGigE::txKick()
                             ip->sum(cksum(ip));
                             txIpChecksums++;
                         } else {
-                            debug_break();
+                            Debug::breakpoint();
                             warn_once("IPPKT set, but not UDP!\n");
                         }
                     }
index 98a2426f59aad62840e06964cadaeaf4aadaef87..9141b629c54b003ef25a80a6ce3f55f88c490571 100644 (file)
@@ -687,7 +687,7 @@ Base::cpuIntrPost(Tick when)
 
     intrTick = when;
     if (intrTick < curTick()) {
-        debug_break();
+        Debug::breakpoint();
         intrTick = curTick();
     }
 
index f8a3215d0dceb4562e95399799b428410a4fc64a..e866c13e77f157dd88f1ae1e64567e8a4e69b5d1 100644 (file)
@@ -67,14 +67,14 @@ DebugBreakEvent::DebugBreakEvent()
 void
 DebugBreakEvent::process()
 {
-    debug_break();
+    Debug::breakpoint();
 }
 
 
 const char *
 DebugBreakEvent::description() const
 {
-    return "debug break";
+    return "debug breakpoint";
 }
 
 //
index 65dd7a1a137dab31c7524208c5c4a1062c2cdd92..3b78cc1ee6e7b42efd58a8e68a965478d12a83c8 100644 (file)
@@ -353,7 +353,7 @@ readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
 void
 debugbreak(ThreadContext *tc)
 {
-    debug_break();
+    Debug::breakpoint();
 }
 
 void