summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common/Debug.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-05-11 10:38:45 -0700
committerNathan Binkert <nate@binkert.org>2009-05-11 10:38:45 -0700
commite1915f16d140f568dc713820189455cfdf5f9772 (patch)
tree5d04f2c73ee2999226af83f80154de5e5bd978e3 /src/mem/ruby/common/Debug.cc
parent6e8373fad6f5faac0648c814f8c7ddc21023dc6c (diff)
downloadgem5-e1915f16d140f568dc713820189455cfdf5f9772.tar.xz
ruby: fold the debugging options into Debug.cc
Diffstat (limited to 'src/mem/ruby/common/Debug.cc')
-rw-r--r--src/mem/ruby/common/Debug.cc39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc
index a07e61b2d..4c2263b0c 100644
--- a/src/mem/ruby/common/Debug.cc
+++ b/src/mem/ruby/common/Debug.cc
@@ -43,20 +43,31 @@ class Debug;
extern Debug* g_debug_ptr;
std::ostream * debug_cout_ptr;
-// component character list
-const char DEFINE_COMP_CHAR[] =
+struct DebugComponentData
{
-#undef DEFINE_COMP
-#define DEFINE_COMP(component, character, description) character,
-#include "Debug.def"
+ const char *desc;
+ const char ch;
};
-// component description list
-const char* DEFINE_COMP_DESCRIPTION[] =
+// component character list
+DebugComponentData debugComponents[] =
{
-#undef DEFINE_COMP
-#define DEFINE_COMP(component, character, description) description,
-#include "Debug.def"
+ {"System", 's' },
+ {"Node", 'N' },
+ {"Queue", 'q' },
+ {"Event Queue", 'e' },
+ {"Network", 'n' },
+ {"Sequencer", 'S' },
+ {"Tester", 't' },
+ {"Generated", 'g' },
+ {"SLICC", 'l' },
+ {"Network Queues", 'Q' },
+ {"Time", 'T' },
+ {"Network Internals", 'i' },
+ {"Store Buffer", 'b' },
+ {"Cache", 'c' },
+ {"Predictor", 'p' },
+ {"Allocator", 'a' },
};
extern "C" void changeDebugVerbosity(VerbosityLevel vb);
@@ -197,7 +208,7 @@ bool Debug::checkFilter(char ch)
{
for (int i=0; i<NUMBER_OF_COMPS; i++) {
// Look at all components to find a character match
- if (DEFINE_COMP_CHAR[i] == ch) {
+ if (debugComponents[i].ch == ch) {
// We found a match - return no error
return false; // no error
}
@@ -263,9 +274,9 @@ bool Debug::addFilter(char ch)
{
for (int i=0; i<NUMBER_OF_COMPS; i++) {
// Look at all components to find a character match
- if (DEFINE_COMP_CHAR[i] == ch) {
+ if (debugComponents[i].ch == ch) {
// We found a match - update the filter bit mask
- cout << " Debug: Adding to filter: '" << ch << "' (" << DEFINE_COMP_DESCRIPTION[i] << ")" << endl;
+ cout << " Debug: Adding to filter: '" << ch << "' (" << debugComponents[i].desc << ")" << endl;
m_filter |= (1 << i);
return false; // no error
}
@@ -291,7 +302,7 @@ void Debug::usageInstructions(void)
{
cerr << "Debug components: " << endl;
for (int i=0; i<NUMBER_OF_COMPS; i++) {
- cerr << " " << DEFINE_COMP_CHAR[i] << ": " << DEFINE_COMP_DESCRIPTION[i] << endl;
+ cerr << " " << debugComponents[i].ch << ": " << debugComponents[i].desc << endl;
}
}