changeset 51cf7f3cf9ac in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=51cf7f3cf9ac
description:
        debug: create a Debug namespace

diffstat:

 src/arch/alpha/ev5.cc  |  2 +-
 src/base/debug.cc      |  8 ++++++--
 src/base/debug.hh      |  6 +++++-
 src/base/statistics.cc |  2 +-
 src/cpu/pc_event.cc    |  2 +-
 src/dev/ns_gige.cc     |  8 ++++----
 src/dev/sinic.cc       |  2 +-
 src/sim/debug.cc       |  4 ++--
 src/sim/pseudo_inst.cc |  2 +-
 9 files changed, 22 insertions(+), 14 deletions(-)

diffs (156 lines):

diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/arch/alpha/ev5.cc
--- a/src/arch/alpha/ev5.cc     Fri Apr 15 10:44:14 2011 -0700
+++ b/src/arch/alpha/ev5.cc     Fri Apr 15 10:44:15 2011 -0700
@@ -289,7 +289,7 @@
       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
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/base/debug.cc
--- a/src/base/debug.cc Fri Apr 15 10:44:14 2011 -0700
+++ b/src/base/debug.cc Fri Apr 15 10:44:15 2011 -0700
@@ -35,12 +35,16 @@
 
 #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
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/base/debug.hh
--- a/src/base/debug.hh Fri Apr 15 10:44:14 2011 -0700
+++ b/src/base/debug.hh Fri Apr 15 10:44:15 2011 -0700
@@ -31,6 +31,10 @@
 #ifndef __BASE_DEBUG_HH__
 #define __BASE_DEBUG_HH__
 
-void debug_break();
+namespace Debug {
+
+void breakpoint();
+
+} // namespace Debug
 
 #endif // __BASE_DEBUG_HH__
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/base/statistics.cc
--- a/src/base/statistics.cc    Fri Apr 15 10:44:14 2011 -0700
+++ b/src/base/statistics.cc    Fri Apr 15 10:44:15 2011 -0700
@@ -130,7 +130,7 @@
 {
     id = id_count++;
     if (debug_break_id >= 0 and debug_break_id == id)
-        debug_break();
+        Debug::breakpoint();
 }
 
 Info::~Info()
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/cpu/pc_event.cc
--- a/src/cpu/pc_event.cc       Fri Apr 15 10:44:14 2011 -0700
+++ b/src/cpu/pc_event.cc       Fri Apr 15 10:44:15 2011 -0700
@@ -132,7 +132,7 @@
 {
     StringWrap name(tc->getCpuPtr()->name() + ".break_event");
     DPRINTFN("break event %s triggered\n", descr());
-    debug_break();
+    Debug::breakpoint();
     if (remove)
         delete this;
 }
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/dev/ns_gige.cc
--- a/src/dev/ns_gige.cc        Fri Apr 15 10:44:14 2011 -0700
+++ b/src/dev/ns_gige.cc        Fri Apr 15 10:44:15 2011 -0700
@@ -937,7 +937,7 @@
 
     intrTick = when;
     if (intrTick < curTick()) {
-        debug_break();
+        Debug::breakpoint();
         intrTick = curTick();
     }
 
@@ -1705,7 +1705,7 @@
                             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 @@
                             tcp->sum(cksum(tcp));
                             txTcpChecksums++;
                         } else {
-                            debug_break();
+                            Debug::breakpoint();
                             warn_once("TCPPKT set, but not UDP!\n");
                         }
                     }
@@ -1725,7 +1725,7 @@
                             ip->sum(cksum(ip));
                             txIpChecksums++;
                         } else {
-                            debug_break();
+                            Debug::breakpoint();
                             warn_once("IPPKT set, but not UDP!\n");
                         }
                     }
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/dev/sinic.cc
--- a/src/dev/sinic.cc  Fri Apr 15 10:44:14 2011 -0700
+++ b/src/dev/sinic.cc  Fri Apr 15 10:44:15 2011 -0700
@@ -687,7 +687,7 @@
 
     intrTick = when;
     if (intrTick < curTick()) {
-        debug_break();
+        Debug::breakpoint();
         intrTick = curTick();
     }
 
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/sim/debug.cc
--- a/src/sim/debug.cc  Fri Apr 15 10:44:14 2011 -0700
+++ b/src/sim/debug.cc  Fri Apr 15 10:44:15 2011 -0700
@@ -67,14 +67,14 @@
 void
 DebugBreakEvent::process()
 {
-    debug_break();
+    Debug::breakpoint();
 }
 
 
 const char *
 DebugBreakEvent::description() const
 {
-    return "debug break";
+    return "debug breakpoint";
 }
 
 //
diff -r 845c8eb5ac49 -r 51cf7f3cf9ac src/sim/pseudo_inst.cc
--- a/src/sim/pseudo_inst.cc    Fri Apr 15 10:44:14 2011 -0700
+++ b/src/sim/pseudo_inst.cc    Fri Apr 15 10:44:15 2011 -0700
@@ -353,7 +353,7 @@
 void
 debugbreak(ThreadContext *tc)
 {
-    debug_break();
+    Debug::breakpoint();
 }
 
 void
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to