aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-07-19 10:42:12 -0700
committerTim Newsome <tim@sifive.com>2022-11-29 13:18:47 -0800
commit55f69cc6467b3700de5bf2b5240663c959bf8dd8 (patch)
tree781703e584b93b93ea9c6c4c5b23ec7b1ba19a97
parentabc065fa941f67aae994ca72c65405b971f7b72a (diff)
downloadriscv-tests-55f69cc6467b3700de5bf2b5240663c959bf8dd8.zip
riscv-tests-55f69cc6467b3700de5bf2b5240663c959bf8dd8.tar.gz
riscv-tests-55f69cc6467b3700de5bf2b5240663c959bf8dd8.tar.bz2
When parking harts, use `cease` if it's supported.
This is a much more comprehensive test of OpenOCD behavior when harts become unavailable.
-rw-r--r--debug/testlib.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index edb903a..21fd720 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -1245,13 +1245,19 @@ class GdbTest(BaseTest):
del self.gdb
BaseTest.classTeardown(self)
- def parkOtherHarts(self, symbol="loop_forever"):
+ def parkOtherHarts(self, symbol=None):
"""Park harts besides the currently selected one in loop_forever()."""
for hart in self.target.harts:
# Park all harts that we're not using in a safe place.
if hart != self.hart:
self.gdb.select_hart(hart)
- self.gdb.p("$pc=%s" % symbol)
+ if symbol is None:
+ if hart.support_cease:
+ self.gdb.p("$pc=cease")
+ else:
+ self.gdb.p("$pc=loop_forever")
+ else:
+ self.gdb.p(f"$pc={symbol}")
self.gdb.select_hart(self.hart)