Add test_hwbp_2.
authorTim Newsome <tim@sifive.com>
Fri, 10 Jun 2016 23:38:37 +0000 (16:38 -0700)
committerTim Newsome <tim@sifive.com>
Tue, 19 Jul 2016 01:51:54 +0000 (18:51 -0700)
debug/gdbserver.py

index 87692abe0eb4d2a389aef28c04cf4aaf90aeddb9..a527ad0baad63488ebabfbd1207749cd44897a27 100755 (executable)
@@ -196,7 +196,7 @@ class DebugTest(DeleteServer):
             #TODO self.assertIn("rot13 ", output)
         self.exit()
 
             #TODO self.assertIn("rot13 ", output)
         self.exit()
 
-    def test_hwbp(self):
+    def test_hwbp_1(self):
         self.gdb.hbreak("rot13")
         # The breakpoint should be hit exactly 2 times.
         for i in range(2):
         self.gdb.hbreak("rot13")
         # The breakpoint should be hit exactly 2 times.
         for i in range(2):
@@ -206,6 +206,17 @@ class DebugTest(DeleteServer):
             #TODO self.assertIn("rot13 ", output)
         self.exit()
 
             #TODO self.assertIn("rot13 ", output)
         self.exit()
 
+    def test_hwbp_2(self):
+        self.gdb.hbreak("main")
+        self.gdb.hbreak("rot13")
+        # We should hit 3 breakpoints.
+        for i in range(3):
+            output = self.gdb.c()
+            self.gdb.p("$pc")
+            self.assertIn("Breakpoint ", output)
+            #TODO self.assertIn("rot13 ", output)
+        self.exit()
+
     def test_too_many_hwbp(self):
         for i in range(30):
             self.gdb.hbreak("*rot13 + %d" % (i * 4))
     def test_too_many_hwbp(self):
         for i in range(30):
             self.gdb.hbreak("*rot13 + %d" % (i * 4))