Only run hwbp tests on targets that support them.
authorTim Newsome <tim@sifive.com>
Wed, 13 Jul 2016 18:25:42 +0000 (11:25 -0700)
committerTim Newsome <tim@sifive.com>
Tue, 19 Jul 2016 18:24:25 +0000 (11:24 -0700)
debug/gdbserver.py

index 652ad3366752ef2b2bfba8d2a84d8c92409e235c..f042e485b10b5fd91886a5c4728a78ee3523f8e7 100755 (executable)
@@ -238,6 +238,9 @@ class DebugTest(DeleteServer):
         self.exit()
 
     def test_hwbp_1(self):
+        if target.instruction_hardware_breakpoint_count < 1:
+            return
+
         self.gdb.hbreak("rot13")
         # The breakpoint should be hit exactly 2 times.
         for i in range(2):
@@ -248,6 +251,9 @@ class DebugTest(DeleteServer):
         self.exit()
 
     def test_hwbp_2(self):
+        if target.instruction_hardware_breakpoint_count < 2:
+            return
+
         self.gdb.hbreak("main")
         self.gdb.hbreak("rot13")
         # We should hit 3 breakpoints.
@@ -450,6 +456,7 @@ class Spike64Target(Target):
     xlen = 64
     ram = 0x80010000
     ram_size = 5 * 1024 * 1024
+    instruction_hardware_breakpoint_count = 0
 
     def server(self):
         return testlib.Spike(parsed.cmd, halted=True)
@@ -460,6 +467,7 @@ class Spike32Target(Target):
     xlen = 32
     ram = 0x80010000
     ram_size = 5 * 1024 * 1024
+    instruction_hardware_breakpoint_count = 0
 
     def server(self):
         return testlib.Spike(parsed.cmd, halted=True, xlen=32)
@@ -469,6 +477,7 @@ class MicroSemiTarget(Target):
     xlen = 32
     ram = 0x80000000
     ram_size = 16 * 1024
+    instruction_hardware_breakpoint_count = 2
 
     def server(self):
         return testlib.Openocd(cmd=parsed.cmd,