From 7ce8ad62d7f1a1e183665418151d7c655c29642a Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 10 Jun 2016 14:29:37 -0700 Subject: [PATCH] Add hwbp test (currently doesn't pass). --- debug/gdbserver.py | 10 ++++++++++ debug/testlib.py | 6 ++++++ 2 files changed, 16 insertions(+) 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 -- 2.30.2