diff options
author | Luke Wren <wren6991@gmail.com> | 2024-08-27 09:06:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 01:06:44 -0700 |
commit | 2f97bab8be351402781fa3517b44811fd0c527f6 (patch) | |
tree | 9c1d46823e51e55343aff80d895fd939714a98cd | |
parent | e2cdf460d248925b43b9085a3470102ce8a0a83b (diff) | |
download | riscv-tests-master.zip riscv-tests-master.tar.gz riscv-tests-master.tar.bz2 |
There is already a mechanism for the test target to supply a known-bad
address, so use that address if it is provided.
-rwxr-xr-x | debug/gdbserver.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 235814a..177d330 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -2125,8 +2125,10 @@ class EtriggerTest(DebugTest): def test(self): # Set trigger on Load access fault self.gdb.command("monitor riscv etrigger set m 0x20") - # Set fox to a null pointer so we'll get a load access exception later. - self.gdb.p("fox=(char*)0") + # Set fox to a bad pointer so we'll get a load access exception later. + # Use NULL if a known-bad address is not provided. + bad_address = self.hart.bad_address or 0 + self.gdb.p(f"fox=(char*)0x{bad_address:08x}") output = self.gdb.c() # We should not be at handle_trap assertNotIn("handle_trap", output) |