changeset 75c0e4915c05 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=75c0e4915c05
description:
        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:

 src/python/m5/SimObject.py |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r a90a81ee8cfe -r 75c0e4915c05 src/python/m5/SimObject.py
--- a/src/python/m5/SimObject.py        Tue Nov 24 10:13:04 2015 +0000
+++ b/src/python/m5/SimObject.py        Tue Dec 01 13:01:05 2015 +0000
@@ -1227,6 +1227,9 @@
     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
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to