Increase "load" timeout.
[riscv-tests.git] / debug / testlib.py
index 21f28d84a6d82ad05351334628a5ef50430fb383..e749a1a7919bbf2827559e098fc187657ee7aa69 100644 (file)
@@ -102,8 +102,8 @@ class Openocd(object):
             pass
 
 class Gdb(object):
-    def __init__(self):
-        path = os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb")
+    def __init__(self,
+            path=os.path.expandvars("$RISCV/bin/riscv64-unknown-elf-gdb")):
         self.child = pexpect.spawn(path)
         self.child.logfile = file("gdb.log", "w")
         self.wait()
@@ -153,7 +153,7 @@ class Gdb(object):
         return output
 
     def load(self):
-        output = self.command("load")
+        output = self.command("load", timeout=60)
         assert "failed" not in  output
         assert "Transfer rate" in output
 
@@ -162,3 +162,9 @@ class Gdb(object):
         assert "not defined" not in output
         assert "Breakpoint" in output
         return output
+
+    def hbreak(self, location):
+        output = self.command("hbreak %s" % location)
+        assert "not defined" not in output
+        assert "Hardware assisted breakpoint" in output
+        return output