SBREAK test now checks EPC value. (#92)
[riscv-tests.git] / debug / testlib.py
index 66b7b388879e34098c3294e18e6f0fd3ffeecc4c..fae2132415d03514339f80ba71f645dfce7a1046 100644 (file)
@@ -420,7 +420,17 @@ class Gdb(object):
             self.active_child.expect("Continuing")
 
     def c_all(self):
-        """Resume every hart."""
+        """
+        Resume every hart.
+
+        This function works fine when using multiple gdb sessions, but the
+        caller must be careful when using it nonetheless. gdb's behavior is to
+        not set breakpoints until just before the hart is resumed, and then
+        clears them as soon as the hart halts. That means that you can't set
+        one software breakpoint, and expect multiple harts to hit it. It's
+        possible that the first hart completes set/run/halt/clear before the
+        second hart even gets to resume, so it will never hit the breakpoint.
+        """
         with PrivateState(self):
             for child in self.children:
                 child.sendline("c")
@@ -545,7 +555,7 @@ def run_all_tests(module, target, parsed):
 
     for name in dir(module):
         definition = getattr(module, name)
-        if type(definition) == type and hasattr(definition, 'test') and \
+        if isinstance(definition, type) and hasattr(definition, 'test') and \
                 (not parsed.test or any(test in name for test in parsed.test)):
             todo.append((name, definition, None))
 
@@ -660,7 +670,6 @@ class BaseTest(object):
         compile_args = getattr(self, 'compile_args', None)
         if compile_args:
             if compile_args not in BaseTest.compiled:
-                # pylint: disable=star-args
                 BaseTest.compiled[compile_args] = \
                         self.target.compile(self.hart, *compile_args)
         self.binary = BaseTest.compiled.get(compile_args)