From 995fa259b95f5c1b77fe768a00a7d444162fb36f Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 6 Jul 2023 14:41:39 -0700 Subject: debug: CeaseRunTest -> UnavailableRunTest Use new spike mechanism to test OpenOCD behavior when the current hart becomes unavailable while running. Create ThreadTerminated exception. --- debug/testlib.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'debug/testlib.py') diff --git a/debug/testlib.py b/debug/testlib.py index fd9882a..63cc49c 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -555,6 +555,9 @@ class UnknownThread(Exception): def __init__(self, explanation): Exception.__init__(self, explanation) +class ThreadTerminated(Exception): + pass + Thread = collections.namedtuple('Thread', ('id', 'description', 'target_id', 'name', 'frame')) @@ -762,6 +765,8 @@ class Gdb: output = self.command(f"thread {h['thread'].id}", ops=5) if "Unknown" in output: raise UnknownThread(output) + if f"Thread ID {h['thread'].id} has terminated" in output: + raise ThreadTerminated(output) def push_state(self): self.stack.append({ -- cgit v1.1