Skip to content

Commit e789d30

Browse files
committed
[debug] check triggers exist in icount/itrigger/etrigger test
1 parent 355f1fb commit e789d30

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

debug/gdbserver.py

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

21792179
class EtriggerTest(DebugTest):
2180+
# TODO: There should be a check that a exception trigger is really not
2181+
# supported if it is marked as unsupported.
2182+
def early_applicable(self):
2183+
return self.target.support_etrigger
2184+
21802185
def setup(self):
21812186
DebugTest.setup(self)
21822187
self.gdb.b("main:start")
@@ -2208,6 +2213,11 @@ def test(self):
22082213
class IcountTest(DebugTest):
22092214
compile_args = ("programs/infinite_loop.S", )
22102215

2216+
# TODO: There should be a check that an instruction count trigger is
2217+
# really not supported if it is marked as unsupported.
2218+
def early_applicable(self):
2219+
return self.target.support_icount
2220+
22112221
def setup(self):
22122222
DebugTest.setup(self)
22132223
self.gdb.b("main")
@@ -2239,8 +2249,10 @@ def test(self):
22392249
class ItriggerTest(GdbSingleHartTest):
22402250
compile_args = ("programs/interrupt.c",)
22412251

2252+
# TODO: There should be a check that a interrupt trigger is really not
2253+
# supported if it is marked as unsupported.
22422254
def early_applicable(self):
2243-
return self.target.supports_clint_mtime
2255+
return self.target.supports_clint_mtime and self.target.support_itrigger
22442256

22452257
def setup(self):
22462258
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)