Skip to content

Commit f37c11c

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

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
@@ -1086,6 +1086,8 @@ def test(self):
10861086
class InterruptTest(GdbSingleHartTest):
10871087
compile_args = ("programs/interrupt.c",)
10881088

1089+
# TODO: There should be a check that a interrupt trigger is really not
1090+
# supported if it is marked as unsupported.
10891091
def early_applicable(self):
10901092
return self.target.supports_clint_mtime
10911093

@@ -2177,6 +2179,11 @@ def test(self):
21772179
assertEqual(before, after)
21782180

21792181
class EtriggerTest(DebugTest):
2182+
# TODO: There should be a check that a exception trigger is really not
2183+
# supported if it is marked as unsupported.
2184+
def early_applicable(self):
2185+
return self.target.support_etrigger
2186+
21802187
def setup(self):
21812188
DebugTest.setup(self)
21822189
self.gdb.b("main:start")
@@ -2208,6 +2215,11 @@ def test(self):
22082215
class IcountTest(DebugTest):
22092216
compile_args = ("programs/infinite_loop.S", )
22102217

2218+
# TODO: There should be a check that an instruction count trigger is
2219+
# really not supported if it is marked as unsupported.
2220+
def early_applicable(self):
2221+
return self.target.support_icount
2222+
22112223
def setup(self):
22122224
DebugTest.setup(self)
22132225
self.gdb.b("main")
@@ -2240,7 +2252,7 @@ class ItriggerTest(GdbSingleHartTest):
22402252
compile_args = ("programs/interrupt.c",)
22412253

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)