Skip to content

Commit 2984ce4

Browse files
committed
[debug] check triggers exist in icount/itrigger/etrigger test
1 parent b694192 commit 2984ce4

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

debug/gdbserver.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,9 @@ def test(self):
21772177
assertEqual(before, after)
21782178

21792179
class EtriggerTest(DebugTest):
2180+
def early_applicable(self):
2181+
return self.target.support_etrigger
2182+
21802183
def setup(self):
21812184
DebugTest.setup(self)
21822185
self.gdb.b("main:start")
@@ -2208,6 +2211,9 @@ def test(self):
22082211
class IcountTest(DebugTest):
22092212
compile_args = ("programs/infinite_loop.S", )
22102213

2214+
def early_applicable(self):
2215+
return self.target.support_icount
2216+
22112217
def setup(self):
22122218
DebugTest.setup(self)
22132219
self.gdb.b("main")
@@ -2240,7 +2246,7 @@ class ItriggerTest(GdbSingleHartTest):
22402246
compile_args = ("programs/interrupt.c",)
22412247

22422248
def early_applicable(self):
2243-
return self.target.supports_clint_mtime
2249+
return self.target.supports_clint_mtime and self.target.support_itrigger
22442250

22452251
def setup(self):
22462252
self.gdb.load()

debug/targets.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ class Target:
148148
# Support set_pmp_deny to create invalid addresses.
149149
support_set_pmp_deny = False
150150

151+
# Supports Instruction count trigger
152+
support_icount = True
153+
154+
# Supports interrupt trigger
155+
support_itrigger = True
156+
157+
# Supports exception trigger
158+
support_etrigger = True
159+
151160
# Internal variables:
152161
directory = None
153162
temporary_files = []

0 commit comments

Comments
 (0)