aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-11-03 09:23:39 -0700
committerGitHub <noreply@github.com>2022-11-03 09:23:39 -0700
commit99bf42aeba0719be2b575acc2f8ae28c55d65204 (patch)
tree5a22a4e7a05974975bc196e7e1ba9adf7977d2df
parentfc8cb130c9289b6ba9377560342c6c3653f6f42b (diff)
downloadriscv-tests-99bf42aeba0719be2b575acc2f8ae28c55d65204.zip
riscv-tests-99bf42aeba0719be2b575acc2f8ae28c55d65204.tar.gz
riscv-tests-99bf42aeba0719be2b575acc2f8ae28c55d65204.tar.bz2
Fix PrivChange test address comparison. (#427)
Before it might fail incorrectly, because main was close to trap_entry.
-rwxr-xr-xdebug/gdbserver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index 0f4640c..21a822c 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -15,7 +15,7 @@ import testlib
from testlib import assertEqual, assertNotEqual, assertIn, assertNotIn
from testlib import assertGreater, assertRegex, assertLess
from testlib import GdbTest, GdbSingleHartTest, TestFailed
-from testlib import assertTrue, TestNotApplicable, CompileError
+from testlib import TestNotApplicable, CompileError
MSTATUS_UIE = 0x00000001
MSTATUS_SIE = 0x00000002
@@ -1621,9 +1621,10 @@ class PrivChange(PrivTest):
# User mode
self.gdb.p("$priv=0")
self.gdb.stepi()
- # Should have taken an exception, so be nowhere near main.
+ # Should have taken an exception, so be at trap_entry
pc = self.gdb.p("$pc")
- assertTrue(pc < main_address or pc > main_address + 0x100)
+ trap_entry = self.gdb.p("&trap_entry")
+ assertEqual(pc, trap_entry)
class CheckMisa(GdbTest):
"""Make sure the misa we're using is actually what the target exposes."""