base,python: Fix to allow multiple --debug-ignore values.

When adding multiple SimObjects to --debug-ignore, either separating the values with
a colon or adding multiple --debug-ignore flags, the previous code only ignored the
last SimObject in the list.  This changeset adds and uses new `ObjectMatch::add` and
`Logger::addIgnore` methods to make the functionality of the flag consistent with
its description.

Change-Id: Ib6967a48611ea59a211f81af2a970c4de429b1be
Signed-off-by: Isaac Sánchez Barrera <isaac.sanchez@bsc.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17488
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Isaac Sánchez Barrera
2019-03-20 14:32:22 +01:00
parent 149c1fc2d0
commit ca4c0a168a
4 changed files with 11 additions and 1 deletions

View File

@@ -43,6 +43,12 @@ ObjectMatch::ObjectMatch(const string &expr)
setExpression(expr);
}
void
ObjectMatch::add(const ObjectMatch &other)
{
tokens.insert(tokens.end(), other.tokens.begin(), other.tokens.end());
}
void
ObjectMatch::setExpression(const string &expr)
{

View File

@@ -47,6 +47,7 @@ class ObjectMatch
public:
ObjectMatch();
ObjectMatch(const std::string &expression);
void add(const ObjectMatch &other);
void setExpression(const std::string &expression);
void setExpression(const std::vector<std::string> &expression);
bool match(const std::string &name) const

View File

@@ -86,6 +86,9 @@ class Logger
/** Set objects to ignore */
void setIgnore(ObjectMatch &ignore_) { ignore = ignore_; }
/** Add objects to ignore */
void addIgnore(const ObjectMatch &ignore_) { ignore.add(ignore_); }
virtual ~Logger() { }
};

View File

@@ -75,7 +75,7 @@ ignore(const char *expr)
{
ObjectMatch ignore(expr);
Trace::getDebugLogger()->setIgnore(ignore);
Trace::getDebugLogger()->addIgnore(ignore);
}
void