diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 5a2ba2abe..31523b168 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -1039,8 +1039,10 @@ def test(self): local = self.gdb.p("local") if interrupt_count > 1000 and \ local > 1000: + self.disable_timer() return + self.disable_timer() assertGreater(interrupt_count, 1000) assertGreater(local, 1000) @@ -1191,6 +1193,8 @@ def test(self): time.sleep(1) self.gdb.p("buf", fmt="") + self.disable_timer(interrupt=True) + class MulticoreRtosSwitchActiveHartTest(GdbTest): compile_args = ("programs/multicore.c", "-DMULTICORE") @@ -1220,6 +1224,8 @@ def test(self): assertIn("set_trap_handler", output) assertNotIn("received signal SIGTRAP", output) + self.disable_timer() + class SmpSimultaneousRunHalt(GdbTest): compile_args = ("programs/run_halt_timing.S", "-DMULTICORE") diff --git a/debug/testlib.py b/debug/testlib.py index 435b41b5a..6f470a0a5 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -1411,6 +1411,13 @@ def disable_pmp(self): # PMP registers are optional pass + def disable_timer(self, interrupt=False): + for hart in self.target.harts: + self.gdb.select_hart(hart) + if interrupt: + self.gdb.interrupt() + self.gdb.p("$mie=$mie & ~0x80") + def exit(self, expected_result=10): self.gdb.command("delete") self.gdb.b("_exit")