summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-04-15 10:44:15 -0700
committerNathan Binkert <nate@binkert.org>2011-04-15 10:44:15 -0700
commitf946d7bcdb4d0b4327857d319dd4ecdd1c320d62 (patch)
treeac1507e1c495e3a86ea43ea1249121ab1e591715 /src/base
parentbbb1392c088f8c41e7e438380f5b5358c41c178a (diff)
downloadgem5-f946d7bcdb4d0b4327857d319dd4ecdd1c320d62.tar.xz
debug: create a Debug namespace
Diffstat (limited to 'src/base')
-rw-r--r--src/base/debug.cc8
-rw-r--r--src/base/debug.hh6
-rw-r--r--src/base/statistics.cc2
3 files changed, 12 insertions, 4 deletions
diff --git a/src/base/debug.cc b/src/base/debug.cc
index 1d7be5a9a..6f01b3fc0 100644
--- a/src/base/debug.cc
+++ b/src/base/debug.cc
@@ -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 --git a/src/base/debug.hh b/src/base/debug.hh
index b1577f782..ee7402912 100644
--- a/src/base/debug.hh
+++ b/src/base/debug.hh
@@ -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 --git a/src/base/statistics.cc b/src/base/statistics.cc
index 5ee018b1c..fa3a4a0c9 100644
--- a/src/base/statistics.cc
+++ b/src/base/statistics.cc
@@ -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()