aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-11-29 10:35:54 -0800
committerTim Newsome <tim@sifive.com>2022-11-29 13:18:47 -0800
commit0786374794da5e33ad96f787d9918d368a54c012 (patch)
treeed3094aed051e5f0677b1fd3dd877afcce2eb7eb
parent55f69cc6467b3700de5bf2b5240663c959bf8dd8 (diff)
downloadriscv-tests-0786374794da5e33ad96f787d9918d368a54c012.zip
riscv-tests-0786374794da5e33ad96f787d9918d368a54c012.tar.gz
riscv-tests-0786374794da5e33ad96f787d9918d368a54c012.tar.bz2
Raise UnknownThread in select_hart()
-rw-r--r--debug/testlib.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index 21fd720..6583393 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -491,6 +491,11 @@ class NoSymbol(Exception):
def __repr__(self):
return f"NoSymbol({self.symbol!r})"
+class UnknownThread(Exception):
+ def __init__(self, hart_id):
+ Exception.__init__(self)
+ self.hart_id = hart_id
+
Thread = collections.namedtuple('Thread', ('id', 'description', 'target_id',
'name', 'frame'))
@@ -686,7 +691,8 @@ class Gdb:
self.select_child(h['child'])
if not h['solo']:
output = self.command(f"thread {h['thread'].id}", ops=5)
- assert "Unknown" not in output
+ if "Unknown thread" in output:
+ raise UnknownThread(hart.id)
def push_state(self):
self.stack.append({