From: Tim Newsome Date: Wed, 7 Sep 2022 18:55:52 +0000 (-0700) Subject: rtos/hwthread: Hide unavailable targets from thread list. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=98ed83e2782bfd242b653bd3190c34d091b3d7b6;p=users%2Fborneoa%2Fopenocd-next.git rtos/hwthread: Hide unavailable targets from thread list. Imported from https://github.com/riscv-collab/riscv-openocd/pull/767 Change-Id: I53c6e2876d9bab70800a0f080e72a2abe0499120 Signed-off-by: Tim Newsome Reviewed-on: https://review.openocd.org/c/openocd/+/8919 Tested-by: jenkins Reviewed-by: Antonio Borneo --- diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 76571c6b6..cc43a07b4 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -105,7 +105,8 @@ static int hwthread_update_threads(struct rtos *rtos) foreach_smp_target(head, target->smp_targets) { struct target *curr = head->target; - if (!target_was_examined(curr)) + if (!target_was_examined(curr) || + curr->state == TARGET_UNAVAILABLE) continue; ++thread_list_size; @@ -130,7 +131,8 @@ static int hwthread_update_threads(struct rtos *rtos) foreach_smp_target(head, target->smp_targets) { struct target *curr = head->target; - if (!target_was_examined(curr)) + if (!target_was_examined(curr) || + curr->state == TARGET_UNAVAILABLE) continue; threadid_t tid = threadid_from_target(curr);