Skip to content

Commit d020e20

Browse files
authored
Merge pull request #513 from lz-bro/nonexist_csr
Make the non-existent csr configurable
2 parents a176b65 + 57544c2 commit d020e20

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

debug/gdbserver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,15 @@ def test(self):
221221

222222
class SimpleNoExistTest(GdbTest):
223223
def test(self):
224+
nonexist_csr = self.hart.nonexist_csr
224225
try:
225-
self.gdb.p("$csr2288")
226-
assert False, "Reading csr2288 should have failed"
226+
self.gdb.p(f"${nonexist_csr}")
227+
assert False, f"Reading the ${nonexist_csr} should have failed"
227228
except testlib.CouldNotFetch:
228229
pass
229230
try:
230-
self.gdb.p("$csr2288=5")
231-
assert False, "Writing csr2288 should have failed"
231+
self.gdb.p(f"${nonexist_csr}=5")
232+
assert False, f"Writing the ${nonexist_csr} should have failed"
232233
except testlib.CouldNotFetch:
233234
pass
234235

debug/targets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class Hart:
3333
# no device mapped to that location.
3434
bad_address = None
3535

36+
# The non-existent register for access test
37+
nonexist_csr = "csr2288"
38+
3639
# Number of instruction triggers the hart supports.
3740
instruction_hardware_breakpoint_count = 0
3841

0 commit comments

Comments
 (0)