diff options
author | Tim Newsome <tim@sifive.com> | 2018-08-08 14:33:50 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-08-13 14:38:12 -0700 |
commit | b37a57cbafe620601102dab278d6e3e11dcb2b81 (patch) | |
tree | 682aa628114d231853f01ac2e0c67f4a0e010cb6 /debug/gdbserver.py | |
parent | 294bfce8a1ca2fc501b8939292146e44f813a2b8 (diff) | |
download | riscv-tests-b37a57cbafe620601102dab278d6e3e11dcb2b81.zip riscv-tests-b37a57cbafe620601102dab278d6e3e11dcb2b81.tar.gz riscv-tests-b37a57cbafe620601102dab278d6e3e11dcb2b81.tar.bz2 |
Add jump/hbreak test.
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-x | debug/gdbserver.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index bd9babc..4eb6038 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -652,6 +652,29 @@ class StepTest(GdbSingleHartTest): pc = self.gdb.p("$pc") assertEqual("%x" % (pc - main_address), "%x" % expected) +class JumpHbreak(GdbSingleHartTest): + """'jump' resumes execution at location. Execution stops again immediately + if there is a breakpoint there. + That second line can be trouble.""" + compile_args = ("programs/trigger.S", ) + + def early_applicable(self): + return self.hart.instruction_hardware_breakpoint_count >= 1 + + def setup(self): + self.gdb.load() + self.gdb.hbreak("main") + self.gdb.c() + self.gdb.command("delete 1") + + def test(self): + self.gdb.b("read_loop") + self.gdb.command("hbreak just_before_read_loop") + output = self.gdb.command("jump just_before_read_loop") + assertRegexpMatches(output, r"Breakpoint \d, just_before_read_loop ") + output = self.gdb.c() + assertRegexpMatches(output, r"Breakpoint \d, read_loop ") + class TriggerTest(GdbSingleHartTest): compile_args = ("programs/trigger.S", ) def setup(self): |