aboutsummaryrefslogtreecommitdiff
path: root/debug/gdbserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug/gdbserver.py')
-rwxr-xr-xdebug/gdbserver.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index 5a2ba2a..23515a3 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -1830,8 +1830,7 @@ class UnavailableMultiTest(GdbTest):
# Other hart should have become unavailable.
if self.target.support_unavailable_control:
self.server.wait_until_running(self.target.harts)
- self.server.command(
- f"riscv dmi_write 0x1f 0x{(1<<self.hart.id)&0x3:x}")
+ self.server.set_available([self.hart])
self.gdb.expect(r"\S+ became unavailable.")
self.gdb.interrupt()
@@ -1901,8 +1900,8 @@ class UnavailableRunTest(ProgramTest):
self.gdb.c(wait=False)
if self.target.support_unavailable_control:
self.server.wait_until_running([self.hart])
- self.server.command(
- f"riscv dmi_write 0x1f 0x{(~(1<<self.hart.id))&0x3:x}")
+ self.server.set_available(
+ [h for h in self.target.harts if h != self.hart])
self.gdb.expect(r"\S+ became unavailable.")
self.gdb.interrupt()
# gdb might automatically switch to the available hart.
@@ -1933,14 +1932,14 @@ class UnavailableCycleTest(ProgramTest):
self.gdb.p("$pc=loop_forever")
self.gdb.c(wait=False)
self.server.wait_until_running([self.hart])
- self.server.command(
- f"riscv dmi_write 0x1f 0x{(~(1<<self.hart.id))&0x3:x}")
+ self.server.set_available(
+ [h for h in self.target.harts if h != self.hart])
self.gdb.expect(r"\S+ became unavailable.")
# Now send a DMI command through OpenOCD to make the hart available
# again.
- self.server.command("riscv dmi_write 0x1f 0x3")
+ self.server.set_available(self.target.harts)
self.gdb.expect(r"\S+ became available")
self.gdb.interrupt()
self.gdb.p("$pc")