Merge remote-tracking branch 'origin/downloadtest' into debug-tests-more-single
authorMegan Wachs <megan@sifive.com>
Mon, 14 May 2018 23:04:10 +0000 (16:04 -0700)
committerMegan Wachs <megan@sifive.com>
Mon, 14 May 2018 23:04:10 +0000 (16:04 -0700)
debug/gdbserver.py
debug/testlib.py

index dd30a3decab5668db62525edf01abac162efe14e..be89d19157b07789be13bad5a105091b393569c5 100755 (executable)
@@ -615,7 +615,7 @@ class MulticoreRunAllHaltOne(GdbTest):
         time.sleep(1)
         self.gdb.p("buf", fmt="")
 
-class StepTest(GdbTest):
+class StepTest(GdbSingleHartTest):
     compile_args = ("programs/step.S", )
 
     def setup(self):
@@ -634,7 +634,7 @@ class StepTest(GdbTest):
             pc = self.gdb.p("$pc")
             assertEqual("%x" % (pc - main_address), "%x" % expected)
 
-class TriggerTest(GdbTest):
+class TriggerTest(GdbSingleHartTest):
     compile_args = ("programs/trigger.S", )
     def setup(self):
         self.gdb.load()
@@ -753,7 +753,7 @@ class TriggerDmode(TriggerTest):
         assertIn("clear_triggers", output)
         self.check_triggers((1<<6) | (1<<0), 0xfeedac00)
 
-class RegsTest(GdbTest):
+class RegsTest(GdbSingleHartTest):
     compile_args = ("programs/regs.S", )
     def setup(self):
         self.gdb.load()
@@ -840,7 +840,7 @@ class DownloadTest(GdbTest):
         assertEqual(self.gdb.p("status"), self.crc)
         os.unlink(self.download_c.name)
 
-#class MprvTest(GdbTest):
+#class MprvTest(GdbSingleHartTest):
 #    compile_args = ("programs/mprv.S", )
 #    def setup(self):
 #        self.gdb.load()
@@ -853,7 +853,7 @@ class DownloadTest(GdbTest):
 #        output = self.gdb.command("p/x *(int*)(((char*)&data)-0x80000000)")
 #        assertIn("0xbead", output)
 
-class PrivTest(GdbTest):
+class PrivTest(GdbSingleHartTest):
     compile_args = ("programs/priv.S", )
     def setup(self):
         # pylint: disable=attribute-defined-outside-init
index 0a6c1856e373e3dac240a0c15f2e1a708bf556ea..fb5bee33b1284b36ecafe918821a979ad1cf738c 100644 (file)
@@ -549,6 +549,8 @@ class Gdb(object):
         output = self.command("load", ops=1000)
         assert "failed" not in  output
         assert "Transfer rate" in output
+        output = self.command("compare-sections", ops=1000)
+        assert "MIS" not in output
 
     def b(self, location):
         output = self.command("b %s" % location, ops=5)
@@ -852,6 +854,8 @@ class GdbTest(BaseTest):
         self.gdb.interrupt()
         self.gdb.command("disassemble", ops=20)
         self.gdb.command("info registers all", ops=100)
+        self.gdb.command("flush regs")
+        self.gdb.command("info threads", ops=100)
 
     def classTeardown(self):
         del self.gdb
@@ -864,6 +868,7 @@ class GdbTest(BaseTest):
             if hart != self.hart:
                 self.gdb.select_hart(hart)
                 self.gdb.p("$pc=loop_forever")
+
         self.gdb.select_hart(self.hart)
 
 class GdbSingleHartTest(GdbTest):