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 <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8919
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Tim Newsome
2022-09-07 11:55:52 -07:00
committed by Antonio Borneo
parent 92287c1a2a
commit 98ed83e278

View File

@@ -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);