diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 92f7ce33f..ab48d580c 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -2177,6 +2177,11 @@ def test(self): assertEqual(before, after) class EtriggerTest(DebugTest): + # TODO: There should be a check that a exception trigger is really not + # supported if it is marked as unsupported. + def early_applicable(self): + return self.target.support_etrigger + def setup(self): DebugTest.setup(self) self.gdb.b("main:start") @@ -2208,6 +2213,11 @@ def test(self): class IcountTest(DebugTest): compile_args = ("programs/infinite_loop.S", ) + # TODO: There should be a check that an instruction count trigger is + # really not supported if it is marked as unsupported. + def early_applicable(self): + return self.target.support_icount + def setup(self): DebugTest.setup(self) self.gdb.b("main") @@ -2239,8 +2249,10 @@ def test(self): class ItriggerTest(GdbSingleHartTest): compile_args = ("programs/interrupt.c",) + # TODO: There should be a check that a interrupt trigger is really not + # supported if it is marked as unsupported. def early_applicable(self): - return self.target.supports_clint_mtime + return self.target.supports_clint_mtime and self.target.support_itrigger def setup(self): self.gdb.load() diff --git a/debug/targets.py b/debug/targets.py index eca02313f..f405fd217 100644 --- a/debug/targets.py +++ b/debug/targets.py @@ -148,6 +148,15 @@ class Target: # Support set_pmp_deny to create invalid addresses. support_set_pmp_deny = False + # Supports Instruction count trigger + support_icount = True + + # Supports interrupt trigger + support_itrigger = True + + # Supports exception trigger + support_etrigger = True + # Internal variables: directory = None temporary_files = []