diff options
author | Tim Newsome <tim@sifive.com> | 2022-11-29 10:35:54 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2022-11-29 13:18:47 -0800 |
commit | 0786374794da5e33ad96f787d9918d368a54c012 (patch) | |
tree | ed3094aed051e5f0677b1fd3dd877afcce2eb7eb | |
parent | 55f69cc6467b3700de5bf2b5240663c959bf8dd8 (diff) | |
download | riscv-tests-0786374794da5e33ad96f787d9918d368a54c012.zip riscv-tests-0786374794da5e33ad96f787d9918d368a54c012.tar.gz riscv-tests-0786374794da5e33ad96f787d9918d368a54c012.tar.bz2 |
Raise UnknownThread in select_hart()
-rw-r--r-- | debug/testlib.py | 8 |
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({ |