diff options
author | Isaac Sánchez Barrera <isaac.sanchez@bsc.es> | 2019-03-20 14:32:22 +0100 |
---|---|---|
committer | Isaac Sánchez Barrera <isaac.sanchez@bsc.es> | 2019-03-26 07:25:11 +0000 |
commit | ca4c0a168ae3a48fe97f0c132fefbf606d925bb8 (patch) | |
tree | b321f70aa9285ed1f55a6eee5a0bea3facb7c49b | |
parent | 149c1fc2d070a8ce073263880ecf2ccf7535e569 (diff) | |
download | gem5-ca4c0a168ae3a48fe97f0c132fefbf606d925bb8.tar.xz |
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>
-rw-r--r-- | src/base/match.cc | 6 | ||||
-rw-r--r-- | src/base/match.hh | 1 | ||||
-rw-r--r-- | src/base/trace.hh | 3 | ||||
-rw-r--r-- | src/python/pybind11/debug.cc | 2 |
4 files changed, 11 insertions, 1 deletions
diff --git a/src/base/match.cc b/src/base/match.cc index dc621b482..03f425f2e 100644 --- a/src/base/match.cc +++ b/src/base/match.cc @@ -44,6 +44,12 @@ ObjectMatch::ObjectMatch(const string &expr) } void +ObjectMatch::add(const ObjectMatch &other) +{ + tokens.insert(tokens.end(), other.tokens.begin(), other.tokens.end()); +} + +void ObjectMatch::setExpression(const string &expr) { tokens.resize(1); diff --git a/src/base/match.hh b/src/base/match.hh index 6e1f03b80..3ef4c8192 100644 --- a/src/base/match.hh +++ b/src/base/match.hh @@ -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 diff --git a/src/base/trace.hh b/src/base/trace.hh index ddf936ecd..ee8737243 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -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() { } }; diff --git a/src/python/pybind11/debug.cc b/src/python/pybind11/debug.cc index 8fcd0cdbc..de8b10316 100644 --- a/src/python/pybind11/debug.cc +++ b/src/python/pybind11/debug.cc @@ -75,7 +75,7 @@ ignore(const char *expr) { ObjectMatch ignore(expr); - Trace::getDebugLogger()->setIgnore(ignore); + Trace::getDebugLogger()->addIgnore(ignore); } void |