Skip to content

Commit

Permalink
Restore the initial value of $stap and $mstatus after test translate
Browse files Browse the repository at this point in the history
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
  • Loading branch information
lz-bro committed Jan 5, 2024
1 parent bd0a19c commit b13dcae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,13 +1671,18 @@ def test_translation(self):
self.gdb.b("error")
self.gdb.b("handle_trap")
self.gdb.b("main:active")
satp=self.gdb.p("$satp")
mstatus=self.gdb.p("$mstatus")

output = self.gdb.c()
assertRegex(output, r"\bmain\b")
assertEqual(0xdeadbeef, self.gdb.p("physical[0]"))
assertEqual(0x55667788, self.gdb.p("physical[1]"))
assertEqual(0xdeadbeef, self.gdb.p("virtual[0]"))
assertEqual(0x55667788, self.gdb.p("virtual[1]"))
# restore $satp $mstatus
self.gdb.p(f"$satp=0x{satp:x}")
self.gdb.p(f"$mstatus=0x{mstatus:x}")

SATP_MODE_OFF = 0
SATP_MODE_SV32 = 1
Expand Down

0 comments on commit b13dcae

Please sign in to comment.