Add hwbp test (currently doesn't pass).
authorTim Newsome <tim@sifive.com>
Fri, 10 Jun 2016 21:29:37 +0000 (14:29 -0700)
committerTim Newsome <tim@sifive.com>
Tue, 19 Jul 2016 01:51:54 +0000 (18:51 -0700)
debug/gdbserver.py
debug/testlib.py

index 5f39db1f253a3c23d8448a27a11eb5fcbe8cc435..e9e75c3dc9778e6b4ddf88cd5ded466829ce6a2a 100755 (executable)
@@ -196,6 +196,16 @@ class DebugTest(DeleteServer):
             #TODO self.assertIn("rot13 ", output)
         self.exit()
 
+    def test_hwbp(self):
+        self.gdb.hbreak("rot13")
+        # The breakpoint should be hit exactly 2 times.
+        for i in range(2):
+            output = self.gdb.c()
+            self.gdb.p("$pc")
+            self.assertIn("Breakpoint ", output)
+            #TODO self.assertIn("rot13 ", output)
+        self.exit()
+
     def test_registers(self):
         # Get to a point in the code where some registers have actually been
         # used.
index 21f28d84a6d82ad05351334628a5ef50430fb383..f8c8062f2b9c05d9416d90099d3e84611924b2d8 100644 (file)
@@ -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 "Breakpoint" in output
+        return output