From: Tim Newsome Date: Fri, 10 Jun 2016 21:29:37 +0000 (-0700) Subject: Add hwbp test (currently doesn't pass). X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=commitdiff_plain;h=7ce8ad62d7f1a1e183665418151d7c655c29642a Add hwbp test (currently doesn't pass). --- diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 5f39db1..e9e75c3 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -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. diff --git a/debug/testlib.py b/debug/testlib.py index 21f28d8..f8c8062 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -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