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);
{
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
}
{
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
}
{
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;
}
}
+++ /dev/null
-DEFINE_COMP(SYSTEM_COMP, 's', "System")
-DEFINE_COMP(NODE_COMP, 'N', "Node")
-DEFINE_COMP(QUEUE_COMP, 'q', "Queue")
-DEFINE_COMP(EVENTQUEUE_COMP, 'e', "Event Queue")
-DEFINE_COMP(NETWORK_COMP, 'n', "Network")
-DEFINE_COMP(SEQUENCER_COMP, 'S', "Sequencer")
-DEFINE_COMP(TESTER_COMP, 't', "Tester")
-DEFINE_COMP(GENERATED_COMP, 'g', "Generated")
-DEFINE_COMP(SLICC_COMP, 'l', "SLICC")
-DEFINE_COMP(NETWORKQUEUE_COMP, 'Q', "Network Queues")
-DEFINE_COMP(TIME_COMP, 'T', "Time")
-DEFINE_COMP(NETWORK_INTERNALS_COMP, 'i', "Network Internals")
-DEFINE_COMP(STOREBUFFER_COMP, 'b', "Store Buffer")
-DEFINE_COMP(CACHE_COMP, 'c', "Cache")
-DEFINE_COMP(PREDICTOR_COMP, 'p', "Predictor")
-DEFINE_COMP(ALLOCATOR_COMP, 'a', "Allocator")
-