summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-05-04 10:08:08 -0400
committerNathan Binkert <nate@binkert.org>2011-05-04 10:08:08 -0400
commit0dffd35741fafc4d51102c7276b61306bfa73d87 (patch)
treed83c99d311e1c5cd8cecfa866655b62c0957f32b /src/base
parent8ce85d3db6681084c5fe50bded0a312e550581ab (diff)
downloadgem5-0dffd35741fafc4d51102c7276b61306bfa73d87.tar.xz
debug: fix help output
Diffstat (limited to 'src/base')
-rw-r--r--src/base/debug.cc4
-rw-r--r--src/base/debug.hh16
2 files changed, 10 insertions, 10 deletions
diff --git a/src/base/debug.cc b/src/base/debug.cc
index be301da07..71675aada 100644
--- a/src/base/debug.cc
+++ b/src/base/debug.cc
@@ -101,14 +101,14 @@ void
CompoundFlag::enable()
{
SimpleFlag::enable();
- for_each(flags.begin(), flags.end(), mem_fun(&Flag::enable));
+ for_each(_kids.begin(), _kids.end(), mem_fun(&Flag::enable));
}
void
CompoundFlag::disable()
{
SimpleFlag::disable();
- for_each(flags.begin(), flags.end(), mem_fun(&Flag::disable));
+ for_each(_kids.begin(), _kids.end(), mem_fun(&Flag::disable));
}
struct AllFlags : public Flag
diff --git a/src/base/debug.hh b/src/base/debug.hh
index ced6b4f48..d43117e71 100644
--- a/src/base/debug.hh
+++ b/src/base/debug.hh
@@ -44,6 +44,7 @@ class Flag
protected:
const char *_name;
const char *_desc;
+ std::vector<Flag *> _kids;
public:
Flag(const char *name, const char *desc);
@@ -51,6 +52,7 @@ class Flag
std::string name() const { return _name; }
std::string desc() const { return _desc; }
+ std::vector<Flag *> kids() { return _kids; }
virtual void enable() = 0;
virtual void disable() = 0;
@@ -77,7 +79,12 @@ class SimpleFlag : public Flag
class CompoundFlag : public SimpleFlag
{
protected:
- std::vector<Flag *> flags;
+ void
+ addFlag(Flag &f)
+ {
+ if (&f != NULL)
+ _kids.push_back(&f);
+ }
public:
CompoundFlag(const char *name, const char *desc,
@@ -99,13 +106,6 @@ class CompoundFlag : public SimpleFlag
addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18); addFlag(f19);
}
- void
- addFlag(Flag &f)
- {
- if (&f != NULL)
- flags.push_back(&f);
- }
-
void enable();
void disable();
};