From f946d7bcdb4d0b4327857d319dd4ecdd1c320d62 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 15 Apr 2011 10:44:15 -0700 Subject: debug: create a Debug namespace --- src/base/debug.cc | 8 ++++++-- src/base/debug.hh | 6 +++++- src/base/statistics.cc | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/base') 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() -- cgit v1.2.3