Make DownloadTest properly park other harts.
authorTim Newsome <tim@sifive.com>
Mon, 14 May 2018 22:14:47 +0000 (15:14 -0700)
committerTim Newsome <tim@sifive.com>
Mon, 14 May 2018 22:14:47 +0000 (15:14 -0700)
debug/gdbserver.py
debug/testlib.py

index 98eb818d5ae4146358b92d6611acd798449c8e13..dd30a3decab5668db62525edf01abac162efe14e 100755 (executable)
@@ -830,10 +830,11 @@ class DownloadTest(GdbTest):
 
         self.binary = self.target.compile(self.hart, self.download_c.name,
                 "programs/checksum.c")
-        self.gdb.command("file %s" % self.binary)
+        self.gdb.global_command("file %s" % self.binary)
 
     def test(self):
         self.gdb.load()
+        self.parkOtherHarts()
         self.gdb.command("b _exit")
         self.gdb.c()
         assertEqual(self.gdb.p("status"), self.crc)
index 0fe0322726a30ce0216ae81a2951bce4b9115948..0a6c1856e373e3dac240a0c15f2e1a708bf556ea 100644 (file)
@@ -857,10 +857,8 @@ class GdbTest(BaseTest):
         del self.gdb
         BaseTest.classTeardown(self)
 
-class GdbSingleHartTest(GdbTest):
-    def classSetup(self):
-        GdbTest.classSetup(self)
-
+    def parkOtherHarts(self):
+        """Park harts besides the currently selected one in loop_forever()."""
         for hart in self.target.harts:
             # Park all harts that we're not using in a safe place.
             if hart != self.hart:
@@ -868,6 +866,11 @@ class GdbSingleHartTest(GdbTest):
                 self.gdb.p("$pc=loop_forever")
         self.gdb.select_hart(self.hart)
 
+class GdbSingleHartTest(GdbTest):
+    def classSetup(self):
+        GdbTest.classSetup(self)
+        self.parkOtherHarts()
+
 class ExamineTarget(GdbTest):
     def test(self):
         for hart in self.target.harts: