debug: output some more useful info into the post-mortem data
[riscv-tests.git] / debug / gdbserver.py
index c7bfbf00393fabb77a1cd1b4121e6aea8984c0f9..98eb818d5ae4146358b92d6611acd798449c8e13 100755 (executable)
@@ -835,7 +835,7 @@ class DownloadTest(GdbTest):
     def test(self):
         self.gdb.load()
         self.gdb.command("b _exit")
-        self.gdb.c(timeout=60)
+        self.gdb.c()
         assertEqual(self.gdb.p("status"), self.crc)
         os.unlink(self.download_c.name)
 
@@ -881,6 +881,14 @@ class PrivRw(PrivTest):
             # PMP registers are optional
             pass
 
+        # Ensure Virtual Memory is disabled if applicable (SATP register is not
+        # reset)
+        try:
+            self.gdb.p("$satp=0")
+        except testlib.CouldNotFetch:
+            # SATP only exists if you have S mode.
+            pass
+
         # Leave the PC at _start, where the first 4 instructions should be
         # legal in any mode.
         for privilege in range(4):