diff options
author | Derek Hower <drh5@cs.wisc.edu> | 2010-01-19 15:48:12 -0600 |
---|---|---|
committer | Derek Hower <drh5@cs.wisc.edu> | 2010-01-19 15:48:12 -0600 |
commit | 279f179babc9e5663156777c533c06edc91bce9a (patch) | |
tree | e6718ee514cc81678491b50562ce8c463c0b20fd /src/mem/ruby/common/Debug.cc | |
parent | 5aa104e072eb20f6aca49b169521b0c2da33c844 (diff) | |
parent | 295516a590b6e47c9a881f193027447e500c749c (diff) | |
download | gem5-279f179babc9e5663156777c533c06edc91bce9a.tar.xz |
merge
Diffstat (limited to 'src/mem/ruby/common/Debug.cc')
-rw-r--r-- | src/mem/ruby/common/Debug.cc | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/mem/ruby/common/Debug.cc b/src/mem/ruby/common/Debug.cc index 1115152f4..cb9fdf082 100644 --- a/src/mem/ruby/common/Debug.cc +++ b/src/mem/ruby/common/Debug.cc @@ -39,6 +39,7 @@ #include "mem/ruby/common/Debug.hh" #include "mem/ruby/eventqueue/RubyEventQueue.hh" #include "mem/gems_common/util.hh" +#include "base/misc.hh" class Debug; extern Debug* g_debug_ptr; @@ -70,6 +71,7 @@ DebugComponentData debugComponents[] = {"Cache", 'c' }, {"Predictor", 'p' }, {"Allocator", 'a' }, + {"Memory", 'M' }, }; extern "C" void changeDebugVerbosity(VerbosityLevel vb); @@ -95,19 +97,27 @@ Debug::Debug() Debug::Debug( const string & name, const vector<string> & argv ) { - for (size_t i=0;i<argv.size();i+=2){ - if (argv[i] == "filter_string") - setFilterString( argv[i+1].c_str() ); - else if (argv[i] == "verbosity_string") + // + // must clear the filter before adding filter strings + // + clearFilter(); + + for (size_t i=0;i<argv.size();i+=2) { + if (argv[i] == "filter_string") { + if (setFilterString(argv[i+1].c_str())) { + fatal("could not set filter string to %s\n", argv[i+1].c_str()); + } + } else if (argv[i] == "verbosity_string") { setVerbosityString( argv[i+1].c_str() ); - else if (argv[i] == "start_time") + } else if (argv[i] == "start_time") { m_starting_cycle = atoi( argv[i+1].c_str() ); - else if (argv[i] == "output_filename") + } else if (argv[i] == "output_filename") { setDebugOutputFile( argv[i+1].c_str() ); - else if (argv[i] == "protocol_trace") + } else if (argv[i] == "protocol_trace") { m_protocol_trace = string_to_bool(argv[i+1]); - else - assert(0); + } else { + fatal("invalid argument %s\n"); + } } } @@ -119,7 +129,8 @@ Debug::Debug( const char *filterString, const char *verboseString, debug_cout_ptr = &cout; m_starting_cycle = filterStartTime; - setFilterString( filterString ); + if (setFilterString(filterString)) + fatal("could not set filter string to %s\n", filterString); setVerbosityString( verboseString ); setDebugOutputFile( filename ); } |