Merge remote-tracking branch 'origin/downloadtest' into debug-tests-more-single
[riscv-tests.git] / debug / gdbserver.py
index 4472bdfbfe5ccb1bf4f6bbd012a08fc835cda18f..be89d19157b07789be13bad5a105091b393569c5 100755 (executable)
@@ -830,25 +830,12 @@ 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):
-        # Some hart will compete the CRC calculation first!
-        # Let them race in RTOS mode.
-        # In non-RTOS mode, only one hart will continue.
-        # This loop will fail because the others won't know 
-        # about '_start'. But if that is the case, they
-        # won't run on the `continue` either, so we don't really care.
-        try:
-            self.gdb.load()
-            for hart in self.target.harts:
-                self.gdb.select_hart(hart)
-                self.gdb.p("$pc=_start")
-        except ValueError: #invalid literal for int() with base 0: 'No symbol table is loaded.  Use the "file" command.'
-            pass
-        finally:
-            
-        self.gdb.select_hart(self.hart)
+        self.gdb.load()
+        self.parkOtherHarts()
+        self.gdb.command("b _exit")
         self.gdb.c()
         assertEqual(self.gdb.p("status"), self.crc)
         os.unlink(self.download_c.name)