From 719afa804522fccf9e6831aa4effcffd6567a246 Mon Sep 17 00:00:00 2001 From: Chris Reed Date: Mon, 27 Apr 2020 12:23:31 -0500 Subject: [PATCH] Handle invalid RTX5 thread state in description property. Fixes #857. --- pyocd/rtos/rtx5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyocd/rtos/rtx5.py b/pyocd/rtos/rtx5.py index b26e3e3a4..911a222d6 100644 --- a/pyocd/rtos/rtx5.py +++ b/pyocd/rtos/rtx5.py @@ -209,7 +209,7 @@ def read_core_registers_raw(self, reg_list): return reg_vals class RTXTargetThread(TargetThread): - """! @brief Base class representing a thread on the target.""" + """! @brief Represents an RTX5 thread on the target.""" STATE_OFFSET = 1 NAME_OFFSET = 4 @@ -278,7 +278,7 @@ def context(self): @property def description(self): - return "%s; Priority %d" % (self.STATES[self._state], self.priority) + return "%s; Priority %d" % (self.STATES.get(self._state, "(Invalid)"), self.priority) @property def name(self):