diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-12-01 13:01:05 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2015-12-01 13:01:05 +0000 |
commit | c84745e2cb3637d23388659cfc31126e4b9e9501 (patch) | |
tree | 98b362cec20be594b372cbfe4ca6241b0598089b /src/python | |
parent | d7e3d94c144147ef9f1f8b6ccf111b3c02a70023 (diff) | |
download | gem5-c84745e2cb3637d23388659cfc31126e4b9e9501.tar.xz |
config: Fix broken SimObject listing
The gem5 option '--list-sim-objects' is supposed to list all available
SimObjects and their parameters. It currently chokes on SimObjects
with parameters that have an object instance as their default
value. This is caused by __str__ in SimObject trying to resolve its
complete path. When the path resolution method reaches the parent
object (a MetaSimObject since it hasn't been instantiated), it dies
with a Python exception.
This changeset adds a guard to stop path resolution if the parent
object is a MetaSimObject.
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/m5/SimObject.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 26463f644..bb834fc0b 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -1227,6 +1227,9 @@ class SimObject(object): def path(self): if not self._parent: return '<orphan %s>' % self.__class__ + elif isinstance(self._parent, MetaSimObject): + return str(self.__class__) + ppath = self._parent.path() if ppath == 'root': return self._name |